text:
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:4.0.30319.34014
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Compare Binary
Option Infer On
Option Strict On
Option Explicit On

Imports OpenRiaServices.DomainServices
Imports OpenRiaServices.DomainServices.Client
Imports OpenRiaServices.DomainServices.Client.ApplicationServices
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Linq
Imports System.Runtime.Serialization
Imports System.ServiceModel
Imports System.Threading
Imports System.Threading.Tasks

Namespace TestDomainServices

    ''' <summary>
    ''' The 'RangeItem' entity class.
    ''' </summary>
    <DataContract([Namespace]:="http://schemas.datacontract.org/2004/07/ServerSideAsyncDomainService")> _
    Partial Public NotInheritable Class RangeItem
        Inherits Entity

        Private _id As Integer

        Private _text As String

#Region "Extensibility Method Definitions"

        ''' <summary>
        ''' This method is invoked from the constructor once initialization is complete and
        ''' can be used for further object setup.
        ''' </summary>
        Partial Private Sub OnCreated()
        End Sub
        Partial Private Sub OnIdChanging(ByVal value As Integer)
        End Sub
        Partial Private Sub OnIdChanged()
        End Sub
        Partial Private Sub OnTextChanging(ByVal value As String)
        End Sub
        Partial Private Sub OnTextChanged()
        End Sub

#End Region

        ''' <summary>
        ''' Initializes a new instance of the <see cref="RangeItem"/> class.
        ''' </summary>
        Public Sub New()
            MyBase.New()
            Me.OnCreated()
        End Sub

        'The following attributes were not generated:
        '
        '- The attribute 'System.ComponentModel.DataAnnotations.EditableAttribute' is not visible in the client project 'VBWpfApplication1'. Are you missing an assembly reference?
        '<EditableAttribute(False, AllowInitialValue := True)> _
        '
        '- The attribute 'System.ComponentModel.DataAnnotations.KeyAttribute' is not visible in the client project 'VBWpfApplication1'. Are you missing an assembly reference?
        '<KeyAttribute()> _
        '
        '- The attribute 'System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute' is not visible in the client project 'VBWpfApplication1'. Are you missing an assembly reference?
        '<RoundtripOriginalAttribute()> _
        '
        ''' <summary>
        ''' Gets or sets the 'Id' value.
        ''' </summary>
        <DataMember()> _
        Public Property Id() As Integer
            Get
                Return Me._id
            End Get
            Set(value As Integer)
                If ((Me._id = value) _
                            = False) Then
                    Me.OnIdChanging(value)
                    Me.ValidateProperty("Id", value)
                    Me._id = value
                    Me.RaisePropertyChanged("Id")
                    Me.OnIdChanged()
                End If
            End Set
        End Property

        ''' <summary>
        ''' Gets or sets the 'Text' value.
        ''' </summary>
        <DataMember()> _
        Public Property Text() As String
            Get
                Return Me._text
            End Get
            Set(value As String)
                If (String.Equals(Me._text, value) = False) Then
                    Me.OnTextChanging(value)
                    Me.RaiseDataMemberChanging("Text")
                    Me.ValidateProperty("Text", value)
                    Me._text = value
                    Me.RaiseDataMemberChanged("Text")
                    Me.OnTextChanged()
                End If
            End Set
        End Property

        ''' <summary>
        ''' Computes a value from the key fields that uniquely identifies this entity instance.
        ''' </summary>
        ''' <returns>An object instance that uniquely identifies this entity instance.</returns>
        Public Overrides Function GetIdentity() As Object
            Return Me._id
        End Function
    End Class

    ''' <summary>
    ''' The DomainContext corresponding to the 'ServerSideAsyncDomainService' DomainService.
    ''' </summary>
    Partial Public NotInheritable Class ServerSideAsyncDomainContext
        Inherits DomainContext

#Region "Extensibility Method Definitions"

        ''' <summary>
        ''' This method is invoked from the constructor once initialization is complete and
        ''' can be used for further object setup.
        ''' </summary>
        Partial Private Sub OnCreated()
        End Sub

#End Region

        ''' <summary>
        ''' Initializes a new instance of the <see cref="ServerSideAsyncDomainContext"/> class.
        ''' </summary>
        Public Sub New()
            Me.New(New Uri("TestDomainServices-ServerSideAsyncDomainService.svc", UriKind.Relative))
        End Sub

        ''' <summary>
        ''' Initializes a new instance of the <see cref="ServerSideAsyncDomainContext"/> class with the specified service URI.
        ''' </summary>
        ''' <param name="serviceUri">The ServerSideAsyncDomainService service URI.</param>
        Public Sub New(ByVal serviceUri As Uri)
            Me.New(DomainContext.CreateDomainClient(GetType(IServerSideAsyncDomainServiceContract), serviceUri, False))
        End Sub

        ''' <summary>
        ''' Initializes a new instance of the <see cref="ServerSideAsyncDomainContext"/> class with the specified <paramref name="domainClient"/>.
        ''' </summary>
        ''' <param name="domainClient">The DomainClient instance to use for this DomainContext.</param>
        Public Sub New(ByVal domainClient As DomainClient)
            MyBase.New(domainClient)
            Me.OnCreated()
        End Sub

        ''' <summary>
        ''' Gets the set of <see cref="RangeItem"/> entity instances that have been loaded into this <see cref="ServerSideAsyncDomainContext"/> instance.
        ''' </summary>
        Public ReadOnly Property RangeItems() As EntitySet(Of RangeItem)
            Get
                Return MyBase.EntityContainer.GetEntitySet(Of RangeItem)()
            End Get
        End Property

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetQueryableRange' query.
        ''' </summary>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetQueryableRangeQuery() As EntityQuery(Of RangeItem)
            Me.ValidateMethod("GetQueryableRangeQuery", Nothing)
            Return MyBase.CreateQuery(Of RangeItem)("GetQueryableRange", Nothing, False, True)
        End Function

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetQueryableRangeWithExceptionFirst' query.
        ''' </summary>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetQueryableRangeWithExceptionFirstQuery() As EntityQuery(Of RangeItem)
            Me.ValidateMethod("GetQueryableRangeWithExceptionFirstQuery", Nothing)
            Return MyBase.CreateQuery(Of RangeItem)("GetQueryableRangeWithExceptionFirst", Nothing, False, True)
        End Function

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetQueryableRangeWithExceptionTask' query.
        ''' </summary>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetQueryableRangeWithExceptionTaskQuery() As EntityQuery(Of RangeItem)
            Me.ValidateMethod("GetQueryableRangeWithExceptionTaskQuery", Nothing)
            Return MyBase.CreateQuery(Of RangeItem)("GetQueryableRangeWithExceptionTask", Nothing, False, True)
        End Function

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetRange' query.
        ''' </summary>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetRangeQuery() As EntityQuery(Of RangeItem)
            Me.ValidateMethod("GetRangeQuery", Nothing)
            Return MyBase.CreateQuery(Of RangeItem)("GetRange", Nothing, False, True)
        End Function

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetRangeById' query.
        ''' </summary>
        ''' <param name="id">The value for the 'id' parameter of the query.</param>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetRangeByIdQuery(ByVal id As Integer) As EntityQuery(Of RangeItem)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("id", id)
            Me.ValidateMethod("GetRangeByIdQuery", parameters)
            Return MyBase.CreateQuery(Of RangeItem)("GetRangeById", parameters, False, False)
        End Function

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetRangeByIdWithExceptionFirst' query.
        ''' </summary>
        ''' <param name="id">The value for the 'id' parameter of the query.</param>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetRangeByIdWithExceptionFirstQuery(ByVal id As Integer) As EntityQuery(Of RangeItem)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("id", id)
            Me.ValidateMethod("GetRangeByIdWithExceptionFirstQuery", parameters)
            Return MyBase.CreateQuery(Of RangeItem)("GetRangeByIdWithExceptionFirst", parameters, False, False)
        End Function

        ''' <summary>
        ''' Gets an EntityQuery instance that can be used to load <see cref="RangeItem"/> entity instances using the 'GetRangeByIdWithExceptionTask' query.
        ''' </summary>
        ''' <param name="id">The value for the 'id' parameter of the query.</param>
        ''' <returns>An EntityQuery that can be loaded to retrieve <see cref="RangeItem"/> entity instances.</returns>
        Public Function GetRangeByIdWithExceptionTaskQuery(ByVal id As Integer) As EntityQuery(Of RangeItem)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("id", id)
            Me.ValidateMethod("GetRangeByIdWithExceptionTaskQuery", parameters)
            Return MyBase.CreateQuery(Of RangeItem)("GetRangeByIdWithExceptionTask", parameters, False, False)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'AddNullableOne' method of the DomainService.
        ''' </summary>
        ''' <param name="number">The value for the 'number' parameter of this action.</param>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function AddNullableOne(ByVal number As Nullable(Of Integer), ByVal callback As Action(Of InvokeOperation(Of Nullable(Of Integer))), ByVal userState As Object) As InvokeOperation(Of Nullable(Of Integer))
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("number", number)
            Me.ValidateMethod("AddNullableOne", parameters)
            Return Me.InvokeOperation(Of Nullable(Of Integer))("AddNullableOne", GetType(Nullable(Of Integer)), parameters, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'AddNullableOne' method of the DomainService.
        ''' </summary>
        ''' <param name="number">The value for the 'number' parameter of this action.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function AddNullableOne(ByVal number As Nullable(Of Integer)) As InvokeOperation(Of Nullable(Of Integer))
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("number", number)
            Me.ValidateMethod("AddNullableOne", parameters)
            Return Me.InvokeOperation(Of Nullable(Of Integer))("AddNullableOne", GetType(Nullable(Of Integer)), parameters, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'AddNullableOne' method of the DomainService.
        ''' </summary>
        ''' <param name="number">The value for the 'number' parameter of this action.</param>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function AddNullableOneAsync(ByVal number As Nullable(Of Integer), Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult(Of Nullable(Of Integer)))
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("number", number)
            Me.ValidateMethod("AddNullableOne", parameters)
            Return Me.InvokeOperationAsync(Of Nullable(Of Integer))("AddNullableOne", parameters, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'AddOne' method of the DomainService.
        ''' </summary>
        ''' <param name="number">The value for the 'number' parameter of this action.</param>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function AddOne(ByVal number As Integer, ByVal callback As Action(Of InvokeOperation(Of Integer)), ByVal userState As Object) As InvokeOperation(Of Integer)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("number", number)
            Me.ValidateMethod("AddOne", parameters)
            Return Me.InvokeOperation(Of Integer)("AddOne", GetType(Integer), parameters, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'AddOne' method of the DomainService.
        ''' </summary>
        ''' <param name="number">The value for the 'number' parameter of this action.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function AddOne(ByVal number As Integer) As InvokeOperation(Of Integer)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("number", number)
            Me.ValidateMethod("AddOne", parameters)
            Return Me.InvokeOperation(Of Integer)("AddOne", GetType(Integer), parameters, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'AddOne' method of the DomainService.
        ''' </summary>
        ''' <param name="number">The value for the 'number' parameter of this action.</param>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function AddOneAsync(ByVal number As Integer, Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult(Of Integer))
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("number", number)
            Me.ValidateMethod("AddOne", parameters)
            Return Me.InvokeOperationAsync(Of Integer)("AddOne", parameters, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'GetLastDelay' method of the DomainService.
        ''' </summary>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function GetLastDelay(ByVal callback As Action(Of InvokeOperation(Of TimeSpan)), ByVal userState As Object) As InvokeOperation(Of TimeSpan)
            Me.ValidateMethod("GetLastDelay", Nothing)
            Return Me.InvokeOperation(Of TimeSpan)("GetLastDelay", GetType(TimeSpan), Nothing, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'GetLastDelay' method of the DomainService.
        ''' </summary>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function GetLastDelay() As InvokeOperation(Of TimeSpan)
            Me.ValidateMethod("GetLastDelay", Nothing)
            Return Me.InvokeOperation(Of TimeSpan)("GetLastDelay", GetType(TimeSpan), Nothing, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'GetLastDelay' method of the DomainService.
        ''' </summary>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function GetLastDelayAsync(Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult(Of TimeSpan))
            Me.ValidateMethod("GetLastDelay", Nothing)
            Return Me.InvokeOperationAsync(Of TimeSpan)("GetLastDelay", Nothing, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'Greet' method of the DomainService.
        ''' </summary>
        ''' <param name="client">The value for the 'client' parameter of this action.</param>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function Greet(ByVal client As String, ByVal callback As Action(Of InvokeOperation(Of String)), ByVal userState As Object) As InvokeOperation(Of String)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("client", client)
            Me.ValidateMethod("Greet", parameters)
            Return Me.InvokeOperation(Of String)("Greet", GetType(String), parameters, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'Greet' method of the DomainService.
        ''' </summary>
        ''' <param name="client">The value for the 'client' parameter of this action.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function Greet(ByVal client As String) As InvokeOperation(Of String)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("client", client)
            Me.ValidateMethod("Greet", parameters)
            Return Me.InvokeOperation(Of String)("Greet", GetType(String), parameters, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'Greet' method of the DomainService.
        ''' </summary>
        ''' <param name="client">The value for the 'client' parameter of this action.</param>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function GreetAsync(ByVal client As String, Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult(Of String))
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("client", client)
            Me.ValidateMethod("Greet", parameters)
            Return Me.InvokeOperationAsync(Of String)("Greet", parameters, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'InvokeWithExceptionFirst' method of the DomainService.
        ''' </summary>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function InvokeWithExceptionFirst(ByVal callback As Action(Of InvokeOperation), ByVal userState As Object) As InvokeOperation
            Me.ValidateMethod("InvokeWithExceptionFirst", Nothing)
            Return Me.InvokeOperation("InvokeWithExceptionFirst", GetType(System.Void), Nothing, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'InvokeWithExceptionFirst' method of the DomainService.
        ''' </summary>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function InvokeWithExceptionFirst() As InvokeOperation
            Me.ValidateMethod("InvokeWithExceptionFirst", Nothing)
            Return Me.InvokeOperation("InvokeWithExceptionFirst", GetType(System.Void), Nothing, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'InvokeWithExceptionFirst' method of the DomainService.
        ''' </summary>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function InvokeWithExceptionFirstAsync(Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult)
            Me.ValidateMethod("InvokeWithExceptionFirst", Nothing)
            Return Me.InvokeOperationAsync("InvokeWithExceptionFirst", Nothing, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'InvokeWithExceptionTask' method of the DomainService.
        ''' </summary>
        ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function InvokeWithExceptionTask(ByVal delay As Integer, ByVal callback As Action(Of InvokeOperation), ByVal userState As Object) As InvokeOperation
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("delay", delay)
            Me.ValidateMethod("InvokeWithExceptionTask", parameters)
            Return Me.InvokeOperation("InvokeWithExceptionTask", GetType(System.Void), parameters, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'InvokeWithExceptionTask' method of the DomainService.
        ''' </summary>
        ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function InvokeWithExceptionTask(ByVal delay As Integer) As InvokeOperation
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("delay", delay)
            Me.ValidateMethod("InvokeWithExceptionTask", parameters)
            Return Me.InvokeOperation("InvokeWithExceptionTask", GetType(System.Void), parameters, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'InvokeWithExceptionTask' method of the DomainService.
        ''' </summary>
        ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function InvokeWithException(ByVal delay As Integer, Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("delay", delay)
            Me.ValidateMethod("InvokeWithExceptionTask", parameters)
            Return Me.InvokeOperationAsync("InvokeWithExceptionTask", parameters, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'SleepAndSetLastDelay' method of the DomainService.
        ''' </summary>
        ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
        ''' <param name="callback">Callback to invoke when the operation completes.</param>
        ''' <param name="userState">Value to pass to the callback.  It can be <c>null</c>.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function SleepAndSetLastDelay(ByVal delay As TimeSpan, ByVal callback As Action(Of InvokeOperation), ByVal userState As Object) As InvokeOperation
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("delay", delay)
            Me.ValidateMethod("SleepAndSetLastDelay", parameters)
            Return Me.InvokeOperation("SleepAndSetLastDelay", GetType(System.Void), parameters, True, callback, userState)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'SleepAndSetLastDelay' method of the DomainService.
        ''' </summary>
        ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Overloads Function SleepAndSetLastDelay(ByVal delay As TimeSpan) As InvokeOperation
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("delay", delay)
            Me.ValidateMethod("SleepAndSetLastDelay", parameters)
            Return Me.InvokeOperation("SleepAndSetLastDelay", GetType(System.Void), parameters, True, Nothing, Nothing)
        End Function

        ''' <summary>
        ''' Asynchronously invokes the 'SleepAndSetLastDelay' method of the DomainService.
        ''' </summary>
        ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
        ''' <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
        ''' <returns>An operation instance that can be used to manage the asynchronous request.</returns>
        Public Function SleepAndSetLastDelayAsync(ByVal delay As TimeSpan, Optional ByVal cancellationToken As CancellationToken = Nothing) As Task(Of InvokeResult)
            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)()
            parameters.Add("delay", delay)
            Me.ValidateMethod("SleepAndSetLastDelay", parameters)
            Return Me.InvokeOperationAsync("SleepAndSetLastDelay", parameters, True, cancellationToken)
        End Function

        ''' <summary>
        ''' Creates a new EntityContainer for this DomainContext's EntitySets.
        ''' </summary>
        ''' <returns>A new container instance.</returns>
        Protected Overrides Function CreateEntityContainer() As EntityContainer
            Return New ServerSideAsyncDomainContextEntityContainer()
        End Function

        ''' <summary>
        ''' Service contract for the 'ServerSideAsyncDomainService' DomainService.
        ''' </summary>
        <ServiceContract()> _
        Public Interface IServerSideAsyncDomainServiceContract

            ''' <summary>
            ''' Asynchronously invokes the 'AddNullableOne' operation.
            ''' </summary>
            ''' <param name="number">The value for the 'number' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/AddNullableOne", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/AddNullableOneResponse")> _
            Function BeginAddNullableOne(ByVal number As Nullable(Of Integer), ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginAddNullableOne'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginAddNullableOne'.</param>
            ''' <returns>The 'Nullable`1' returned from the 'AddNullableOne' operation.</returns>
            Function EndAddNullableOne(ByVal result As IAsyncResult) As Nullable(Of Integer)

            ''' <summary>
            ''' Asynchronously invokes the 'AddOne' operation.
            ''' </summary>
            ''' <param name="number">The value for the 'number' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/AddOne", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/AddOneResponse")> _
            Function BeginAddOne(ByVal number As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginAddOne'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginAddOne'.</param>
            ''' <returns>The 'Int32' returned from the 'AddOne' operation.</returns>
            Function EndAddOne(ByVal result As IAsyncResult) As Integer

            ''' <summary>
            ''' Asynchronously invokes the 'GetLastDelay' operation.
            ''' </summary>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetLastDelay", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetLastDelayResponse")> _
            Function BeginGetLastDelay(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetLastDelay'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetLastDelay'.</param>
            ''' <returns>The 'TimeSpan' returned from the 'GetLastDelay' operation.</returns>
            Function EndGetLastDelay(ByVal result As IAsyncResult) As TimeSpan

            ''' <summary>
            ''' Asynchronously invokes the 'GetQueryableRange' operation.
            ''' </summary>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetQueryableRange", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetQueryableRangeRespons" & _
                "e")> _
            Function BeginGetQueryableRange(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetQueryableRange'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetQueryableRange'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetQueryableRange' operation.</returns>
            Function EndGetQueryableRange(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'GetQueryableRangeWithExceptionFirst' operation.
            ''' </summary>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetQueryableRangeWithExceptionFir" & _
                "st", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetQueryableRangeWithExceptionFir" & _
                "stResponse")> _
            Function BeginGetQueryableRangeWithExceptionFirst(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetQueryableRangeWithExceptionFirst'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetQueryableRangeWithExceptionFirst'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetQueryableRangeWithExceptionFirst' operation.</returns>
            Function EndGetQueryableRangeWithExceptionFirst(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'GetQueryableRangeWithExceptionTask' operation.
            ''' </summary>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetQueryableRangeWithExceptionTas" & _
                "k", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetQueryableRangeWithExceptionTas" & _
                "kResponse")> _
            Function BeginGetQueryableRangeWithExceptionTask(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetQueryableRangeWithExceptionTask'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetQueryableRangeWithExceptionTask'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetQueryableRangeWithExceptionTask' operation.</returns>
            Function EndGetQueryableRangeWithExceptionTask(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'GetRange' operation.
            ''' </summary>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetRange", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeResponse")> _
            Function BeginGetRange(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetRange'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetRange'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetRange' operation.</returns>
            Function EndGetRange(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'GetRangeById' operation.
            ''' </summary>
            ''' <param name="id">The value for the 'id' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeById", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeByIdResponse")> _
            Function BeginGetRangeById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetRangeById'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetRangeById'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetRangeById' operation.</returns>
            Function EndGetRangeById(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'GetRangeByIdWithExceptionFirst' operation.
            ''' </summary>
            ''' <param name="id">The value for the 'id' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeByIdWithExceptionFirst", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeByIdWithExceptionFirstRes" & _
                "ponse")> _
            Function BeginGetRangeByIdWithExceptionFirst(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetRangeByIdWithExceptionFirst'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetRangeByIdWithExceptionFirst'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetRangeByIdWithExceptionFirst' operation.</returns>
            Function EndGetRangeByIdWithExceptionFirst(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'GetRangeByIdWithExceptionTask' operation.
            ''' </summary>
            ''' <param name="id">The value for the 'id' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(False), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeByIdWithExceptionTask", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GetRangeByIdWithExceptionTaskResp" & _
                "onse")> _
            Function BeginGetRangeByIdWithExceptionTask(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGetRangeByIdWithExceptionTask'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGetRangeByIdWithExceptionTask'.</param>
            ''' <returns>The 'QueryResult' returned from the 'GetRangeByIdWithExceptionTask' operation.</returns>
            Function EndGetRangeByIdWithExceptionTask(ByVal result As IAsyncResult) As QueryResult(Of RangeItem)

            ''' <summary>
            ''' Asynchronously invokes the 'Greet' operation.
            ''' </summary>
            ''' <param name="client">The value for the 'client' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/Greet", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/GreetResponse")> _
            Function BeginGreet(ByVal client As String, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginGreet'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginGreet'.</param>
            ''' <returns>The 'String' returned from the 'Greet' operation.</returns>
            Function EndGreet(ByVal result As IAsyncResult) As String

            ''' <summary>
            ''' Asynchronously invokes the 'InvokeWithExceptionFirst' operation.
            ''' </summary>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/InvokeWithExceptionFirst", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/InvokeWithExceptionFirstResponse")> _
            Function BeginInvokeWithExceptionFirst(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginInvokeWithExceptionFirst'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginInvokeWithExceptionFirst'.</param>
            Sub EndInvokeWithExceptionFirst(ByVal result As IAsyncResult)

            ''' <summary>
            ''' Asynchronously invokes the 'InvokeWithExceptionTask' operation.
            ''' </summary>
            ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/InvokeWithExceptionTask", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/InvokeWithExceptionTaskResponse")> _
            Function BeginInvokeWithExceptionTask(ByVal delay As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginInvokeWithExceptionTask'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginInvokeWithExceptionTask'.</param>
            Sub EndInvokeWithExceptionTask(ByVal result As IAsyncResult)

            ''' <summary>
            ''' Asynchronously invokes the 'SleepAndSetLastDelay' operation.
            ''' </summary>
            ''' <param name="delay">The value for the 'delay' parameter of this action.</param>
            ''' <param name="callback">Callback to invoke on completion.</param>
            ''' <param name="asyncState">Optional state object.</param>
            ''' <returns>An IAsyncResult that can be used to monitor the request.</returns>
            <HasSideEffects(True), _
             OperationContract(AsyncPattern:=True, Action:="http://tempuri.org/ServerSideAsyncDomainService/SleepAndSetLastDelay", ReplyAction:="http://tempuri.org/ServerSideAsyncDomainService/SleepAndSetLastDelayResponse")> _
            Function BeginSleepAndSetLastDelay(ByVal delay As TimeSpan, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult

            ''' <summary>
            ''' Completes the asynchronous operation begun by 'BeginSleepAndSetLastDelay'.
            ''' </summary>
            ''' <param name="result">The IAsyncResult returned from 'BeginSleepAndSetLastDelay'.</param>
            Sub EndSleepAndSetLastDelay(ByVal result As IAsyncResult)
        End Interface

        Friend NotInheritable Class ServerSideAsyncDomainContextEntityContainer
            Inherits EntityContainer

            Public Sub New()
                MyBase.New()
                Me.CreateEntitySet(Of RangeItem)(EntitySetOperations.None)
            End Sub
        End Class
    End Class
End Namespace


text:
apps_zip "Alfred" do
  source "http://cachefly.alfredapp.com/Alfred_2.2_243b.zip"
end

redpajama_set_name: RedPajamaGithub


text:
//
// Copyright (c) 2004-2017 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen
//
// 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 Jaroslaw Kowalski 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.
//

namespace NLog.Internal
{
    using System;
    using System.Text;
    using System.Threading;

    internal class StringBuilderPool
    {
        private StringBuilder _fastPool;
        private readonly StringBuilder[] _slowPool;
        private readonly int _maxBuilderCapacity;

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="poolCapacity">Max number of items</param>
        /// <param name="initialBuilderCapacity">Initial StringBuilder Size</param>
        /// <param name="maxBuilderCapacity">Max StringBuilder Size</param>
        public StringBuilderPool(int poolCapacity, int initialBuilderCapacity = 16 * 1024, int maxBuilderCapacity = 512 * 1024)
        {
            _fastPool = new StringBuilder(initialBuilderCapacity);
            _slowPool = new StringBuilder[poolCapacity];
            for (int i = 0; i < _slowPool.Length; ++i)
            {
                _slowPool[i] = new StringBuilder(initialBuilderCapacity);
            }
            _maxBuilderCapacity = maxBuilderCapacity;
        }

        /// <summary>
        /// Takes StringBuilder from pool
        /// </summary>
        /// <returns>Allow return to pool</returns>
        public ItemHolder Acquire()
        {
            StringBuilder item = _fastPool;
            if (item == null || item != Interlocked.CompareExchange(ref _fastPool, null, item))
            {
                for (int i = 0; i < _slowPool.Length; i++)
                {
                    item = _slowPool[i];
                    if (item != null && item == Interlocked.CompareExchange(ref _slowPool[i], null, item))
                    {
                        return new ItemHolder(item, this, i);
                    }
                }

                return new ItemHolder(new StringBuilder(), null, 0);
            }
            else
            {
                return new ItemHolder(item, this, -1);
            }
        }

        /// <summary>
        /// Releases StringBuilder back to pool at its right place
        /// </summary>
        private void Release(StringBuilder stringBuilder, int poolIndex)
        {
            if (stringBuilder.Length > _maxBuilderCapacity)
            {
                stringBuilder = new StringBuilder(_maxBuilderCapacity / 2);
            }
            else
            {
                stringBuilder.Length = 0;
            }

            if (poolIndex == -1)
            {
                _fastPool = stringBuilder;
            }
            else
            {
                _slowPool[poolIndex] = stringBuilder;
            }
        }

        /// <summary>
        /// Keeps track of acquired pool item
        /// </summary>
        public struct ItemHolder : IDisposable
        {
            public readonly StringBuilder Item;
            readonly StringBuilderPool _owner;
            readonly int _poolIndex;

            public ItemHolder(StringBuilder stringBuilder, StringBuilderPool owner, int poolIndex)
            {
                Item = stringBuilder;
                _owner = owner;
                _poolIndex = poolIndex;
            }

            /// <summary>
            /// Releases pool item back into pool
            /// </summary>
            public void Dispose()
            {
                if (_owner != null)
                {
                    _owner.Release(Item, _poolIndex);
                }
            }
        }
    }
}


text:
class MoveLoop;
class WindowManagerApplication;

using WindowManagerErrorCodeCallback =
    const mojo::Callback<void(mus::mojom::WindowManagerErrorCode)>;

class WindowManagerImpl : public mus::mojom::WindowManager,
                          public mus::WindowObserver {
 public:
  explicit WindowManagerImpl(WindowManagerApplication* state);
  ~WindowManagerImpl() override;

 private:
  // mus::mojom::WindowManager:
  void OpenWindow(
      mus::mojom::WindowTreeClientPtr client,
      mojo::Map<mojo::String, mojo::Array<uint8_t>> properties) override;
  void SetPreferredSize(
      mus::Id window_id,
      mojo::SizePtr size,
      const WindowManagerErrorCodeCallback& callback) override;
  void SetShowState(mus::Id window_id,
                    mus::mojom::ShowState show_state,
                    const WindowManagerErrorCodeCallback& callback) override;
  void SetResizeBehavior(uint32_t window_id,
                         mus::mojom::ResizeBehavior resize_behavior) override;
  void GetConfig(const GetConfigCallback& callback) override;

  // mus::WindowObserver:
  void OnWindowDestroyed(mus::Window* window) override;
  void OnWindowInputEvent(mus::Window* window,
                          const mus::mojom::EventPtr& event) override;

  mus::Window* GetContainerForChild(mus::Window* child);

  WindowManagerApplication* state_;
  scoped_ptr<MoveLoop> move_loop_;

  DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl);
};

#endif  // COMPONENTS_MUS_EXAMPLE_WM_WINDOW_MANAGER_IMPL_H_


text:
<template name="register">

Register

  <form class="register">

Email: <input type="email" name="email">

Password: <input type="password" name="password">

<input type="submit" value="Register">

  </form>
</template>


text:
EW_ENTER

IWnd_textctrl::IWnd_textctrl(wxWindow* p,const WndPropertyEx& h,int w)
	:wxTextCtrl(p,h.id(),h.value(),h,h,h.flag_text()|w)
{
	if(!h.flags().get(IDefs::IWND_MULTILINE))
	{
		this->SetHint(h.hint());
		this->Connect(wxEVT_TEXT_ENTER,wxCommandEventHandler(IWnd_controlT<IWnd_textctrl>::OnEnter));
	}
	this->GetExtraStyle();

	this->Connect(wxEVT_TEXT,wxCharEventHandler(IWnd_controlT<IWnd_textctrl>::OnChar));
	this->Connect(wxEVT_MENU,wxCommandEventHandler(IWnd_controlT<IWnd_textctrl>::OnCommandEditEvent));
	this->Connect(wxEVT_RIGHT_UP,wxMouseEventHandler(IWnd_controlT<IWnd_textctrl>::OnContextEditMenu));

}

IWnd_password::IWnd_password(wxWindow* p,const WndPropertyEx& h):IWnd_textctrl(p,h,wxTE_PASSWORD)
{

}

class IWndControlT_SearchCtrl : public IWnd_controlT<IWnd_search>
{
public:
	void OnClear(wxCommandEvent&)
	{
		if(!m_pVald) return;
		this->Clear();
		m_pVald->WndExecuteEx(IDefs::ACTION_VALUE_CHANGED);
	}
};

IWnd_search::IWnd_search()
{

}

IWnd_search::IWnd_search(wxWindow* p,const WndPropertyEx& h)
	:wxSearchCtrl(p,h.id(),wxEmptyString,h,h,wxTE_PROCESS_ENTER)
{
	this->ShowCancelButton(true);
	this->Connect(wxEVT_TEXT,wxCharEventHandler(IWnd_controlT<IWnd_search>::OnChar));
	this->Connect(wxEVT_TEXT_ENTER,wxCommandEventHandler(IWnd_controlT<IWnd_search>::OnEnter));

	this->Connect(wxEVT_SEARCHCTRL_CANCEL_BTN,wxCommandEventHandler(IWndControlT_SearchCtrl::OnClear));
}

template<>
class ValidatorW<IWnd_textctrl> : public ValidatorW<wxTextEntryBase>
{
public:
	LitePtrT<IWnd_textctrl> pWindow;
	ValidatorW(IWnd_textctrl* w):ValidatorW<wxTextEntryBase>(w),pWindow(w)
	{
		pWindow->m_pVald.reset(this);
	}
	wxWindow* GetWindow(){ return pWindow; }
};

template<>
class ValidatorW<IWnd_search> : public ValidatorW<wxTextEntryBase>
{
public:
	LitePtrT<IWnd_search> pWindow;
	ValidatorW(IWnd_search* w):ValidatorW<wxTextEntryBase>(w),pWindow(w)
	{
		pWindow->m_pVald.reset(this);
	}
};

template<>
class WndInfoT<IWnd_textctrl> : public WndInfoBaseT<IWnd_textctrl>
{
public:

	WndInfoT(const String& s):WndInfoBaseT<IWnd_textctrl>(s)
	{

	}

	virtual Validator* CreateValidator(wxWindow* w,EvtProxyT<int32_t>* p)
	{
		return CreateValidatorBaseT(w,p);
	}

	virtual Validator* CreateValidator(wxWindow* w,EvtProxyT<String>* p)
	{
		return CreateValidatorBaseT(w,p);
	}

	virtual Validator* CreateValidator(wxWindow* w,EvtProxyT<double>* p)
	{
		return CreateValidatorBaseT(w,p);
	}

	Validator* CreateValidator(wxWindow* w,EvtBase* p)
	{
		return CreateValidatorVoidT(w,p);
	}

	Validator* CreateValidator(wxWindow* w)
	{
		return new ValidatorW<IWnd_textctrl>((IWnd_textctrl*)w);
	}
};

template<>
class WndInfoT<IWnd_password> : public WndInfoT<IWnd_textctrl>
{
public:
	typedef IWnd_password T;

	WndInfoT(const String& s):WndInfoT<IWnd_textctrl>(s){}

	wxWindow* Create(wxWindow* w,const WndPropertyEx& h)
	{
		return new T(w,h);
	}

};

template<>
class WndInfoT<IWnd_search> : public WndInfoBaseT<IWnd_search>
{
public:

	WndInfoT(const String& s):WndInfoBaseT<IWnd_search>(s)
	{

	}

	virtual Validator* CreateValidator(wxWindow* w,EvtProxyT<int32_t>* p)
	{
		return CreateValidatorBaseT(w,p);
	}

	virtual Validator* CreateValidator(wxWindow* w,EvtProxyT<String>* p)
	{
		return CreateValidatorBaseT(w,p);
	}

	virtual Validator* CreateValidator(wxWindow* w,EvtProxyT<double>* p)
	{
		return CreateValidatorBaseT(w,p);
	}

	Validator* CreateValidator(wxWindow* w,EvtBase* p)
	{
		return CreateValidatorVoidT(w,p);
	}

	Validator* CreateValidator(wxWindow* w)
	{
		return new ValidatorW<IWnd_search>((IWnd_search*)w);
	}
};

template<>
void WndInfoManger_Register<IWnd_textctrl>(WndInfoManger& imgr,const String& name)
{
	static WndInfoT<IWnd_textctrl> info(name);
	imgr.Register(&info);
}

template<>
void WndInfoManger_Register<IWnd_password>(WndInfoManger& imgr,const String& name)
{
	static WndInfoT<IWnd_password> info(name);
	imgr.Register(&info);
}

template<>
void WndInfoManger_Register<IWnd_search>(WndInfoManger& imgr,const String& name)
{
	static WndInfoT<IWnd_search> info(name);
	imgr.Register(&info);
}

ICmdProcTextEntryCtrl::ICmdProcTextEntryCtrl(IWnd_textctrl& t):basetype(t),Target(t),data(IDat_search::current()){}

bool ICmdProcTextEntryCtrl::TestSelection()
{
	long p1,p2(0);
	Target.GetSelection(&p1,&p2);
	if(p1==p2)
	{
		return false;
	}

	if(Target.GetStringSelection()==str2wx(data.text_old))
	{
		return true;
	}
	return false;
}

bool ICmdProcTextEntryCtrl::DoFind(ICmdParam& cmd)
{

	long p1,p2(0);
	Target.GetSelection(&p1,&p2);

	if(TestSelection())
	{
		p1=p2;
	}
	else
	{
		p1=Target.GetInsertionPoint();
	}

	Target.SetSelection(p1,-1);
	wxString v=Target.GetStringSelection();

	long n=v.Find(str2wx(data.text_old));
	if(n<0)
	{
		Target.SelectNone();
		return false;
	}

	p1+=n;
	p2=p1+data.text_old.size();

	Target.SetInsertionPoint(p1);
	Target.SetSelection(p1,p2);

	return true;
}

bool ICmdProcTextEntryCtrl::DoReplace(ICmdParam& cmd)
{
	if(!TestSelection())
	{
		return DoFind(cmd);
	}

	long p1,p2(0);
	Target.GetSelection(&p1,&p2);

	Target.Replace(p1,p2,str2wx(data.text_new));
	p2=p1+data.text_new.size();

	Target.SetInsertionPoint(p2);
	Target.SetSelection(p1,p2);

	DoFind(cmd);
	return true;
}

bool ICmdProcTextEntryCtrl::DoReplaceAll(ICmdParam& cmd)
{
	cmd.param2=1;

	Target.SetInsertionPoint(0);
	if(!TestSelection() && !DoFind(cmd))
	{
		Wrapper::MsgsDialog(_hT("no result!"),0);
		return false;
	}

	int n=0;
	try
	{
		while(DoReplace(cmd)) n++;
	}
	catch(std::exception&)
	{

	}

	Wrapper::MsgsDialog(String::Format(_hT("%d results!"),n),0);
	return true;
}

bool ICmdProcTextEntryCtrl::DoExecId(ICmdParam& cmd)
{
	switch(cmd.param1)
	{
	case CP_DIRTY:
		Target.MarkDirty();
		break;
	case CP_FIND:
		if(data.text_old=="") return false;
		return DoFind(cmd);
	case CP_REPLACE:
		if(data.text_old=="") return false;
		return DoReplace(cmd);
	case CP_REPLACEALL:
		if(data.text_old=="") return false;
		return DoReplaceAll(cmd);
	default:
		return basetype::DoExecId(cmd);
	}
	return true;
}

bool ICmdProcTextEntryCtrl::DoTestId(ICmdParam& cmd)
{
	switch(cmd.param1)
	{
	case CP_DIRTY:
		return Target.IsModified();
	case CP_SAVEAS:
		return true;
	default:
		return basetype::DoTestId(cmd);
	}
}

template class DLLIMPEXP_EWC_BASE IWnd_controlT<IWnd_search>;

EW_LEAVE


text:
class CreateTasks < ActiveRecord::Migration
  def self.up
    create_table :tasks do |t|
      t.string :name
      t.text :notes
      t.integer :minutes
      t.integer :project_id
      t.integer :user_id
      t.date :tday

      t.timestamps
    end
  end

  def self.down
    drop_table :tasks
  end
end


text:
<?php
/**
 * ALIPAY API: alipay.ebpp.pdeduct.pay request
 *
 * @author auto create
 * @since 1.0, 2017-04-07 16:45:48
 */
class AlipayEbppPdeductPayRequest
{
	/**
	 * 渠道码,如用户通过机构通过服务窗进来签约则是PUBLICFORM,此值可随意传,只要不空就行
	 **/
	private $agentChannel;

	/**
	 * 二级渠道码,预留字段
	 **/
	private $agentCode;

	/**
	 * 支付宝代扣协议Id
	 **/
	private $agreementId;

	/**
	 * 账期
	 **/
	private $billDate;

	/**
	 * 户号,缴费单位用于标识每一户的唯一性的
	 **/
	private $billKey;

	/**
	 * 扩展参数。必须以key value形式定义,
转为json为格式:{"key1":"value1","key2":"value2",
"key3":"value3","key4":"value4"}
 后端会直接转换为MAP对象,转换异常会报参数格式错误
	 **/
	private $extendField;

	/**
	 * 滞纳金
	 **/
	private $fineAmount;

	/**
	 * 备注信息
	 **/
	private $memo;

	/**
	 * 商户外部业务流水号
	 **/
	private $outOrderNo;

	/**
	 * 扣款金额,支付总金额,包含滞纳金
	 **/
	private $payAmount;

	/**
	 * 商户PartnerId
	 **/
	private $pid;

	/**
	 * 用户ID
	 **/
	private $userId;

	private $apiParas = array();
	private $terminalType;
	private $terminalInfo;
	private $prodCode;
	private $apiVersion="1.0";
	private $notifyUrl;
	private $returnUrl;
    private $needEncrypt=false;

	public function setAgentChannel($agentChannel)
	{
		$this->agentChannel = $agentChannel;
		$this->apiParas["agent_channel"] = $agentChannel;
	}

	public function getAgentChannel()
	{
		return $this->agentChannel;
	}

	public function setAgentCode($agentCode)
	{
		$this->agentCode = $agentCode;
		$this->apiParas["agent_code"] = $agentCode;
	}

	public function getAgentCode()
	{
		return $this->agentCode;
	}

	public function setAgreementId($agreementId)
	{
		$this->agreementId = $agreementId;
		$this->apiParas["agreement_id"] = $agreementId;
	}

	public function getAgreementId()
	{
		return $this->agreementId;
	}

	public function setBillDate($billDate)
	{
		$this->billDate = $billDate;
		$this->apiParas["bill_date"] = $billDate;
	}

	public function getBillDate()
	{
		return $this->billDate;
	}

	public function setBillKey($billKey)
	{
		$this->billKey = $billKey;
		$this->apiParas["bill_key"] = $billKey;
	}

	public function getBillKey()
	{
		return $this->billKey;
	}

	public function setExtendField($extendField)
	{
		$this->extendField = $extendField;
		$this->apiParas["extend_field"] = $extendField;
	}

	public function getExtendField()
	{
		return $this->extendField;
	}

	public function setFineAmount($fineAmount)
	{
		$this->fineAmount = $fineAmount;
		$this->apiParas["fine_amount"] = $fineAmount;
	}

	public function getFineAmount()
	{
		return $this->fineAmount;
	}

	public function setMemo($memo)
	{
		$this->memo = $memo;
		$this->apiParas["memo"] = $memo;
	}

	public function getMemo()
	{
		return $this->memo;
	}

	public function setOutOrderNo($outOrderNo)
	{
		$this->outOrderNo = $outOrderNo;
		$this->apiParas["out_order_no"] = $outOrderNo;
	}

	public function getOutOrderNo()
	{
		return $this->outOrderNo;
	}

	public function setPayAmount($payAmount)
	{
		$this->payAmount = $payAmount;
		$this->apiParas["pay_amount"] = $payAmount;
	}

	public function getPayAmount()
	{
		return $this->payAmount;
	}

	public function setPid($pid)
	{
		$this->pid = $pid;
		$this->apiParas["pid"] = $pid;
	}

	public function getPid()
	{
		return $this->pid;
	}

	public function setUserId($userId)
	{
		$this->userId = $userId;
		$this->apiParas["user_id"] = $userId;
	}

	public function getUserId()
	{
		return $this->userId;
	}

	public function getApiMethodName()
	{
		return "alipay.ebpp.pdeduct.pay";
	}

	public function setNotifyUrl($notifyUrl)
	{
		$this->notifyUrl=$notifyUrl;
	}

	public function getNotifyUrl()
	{
		return $this->notifyUrl;
	}

	public function setReturnUrl($returnUrl)
	{
		$this->returnUrl=$returnUrl;
	}

	public function getReturnUrl()
	{
		return $this->returnUrl;
	}

	public function getApiParas()
	{
		return $this->apiParas;
	}

	public function getTerminalType()
	{
		return $this->terminalType;
	}

	public function setTerminalType($terminalType)
	{
		$this->terminalType = $terminalType;
	}

	public function getTerminalInfo()
	{
		return $this->terminalInfo;
	}

	public function setTerminalInfo($terminalInfo)
	{
		$this->terminalInfo = $terminalInfo;
	}

	public function getProdCode()
	{
		return $this->prodCode;
	}

	public function setProdCode($prodCode)
	{
		$this->prodCode = $prodCode;
	}

	public function setApiVersion($apiVersion)
	{
		$this->apiVersion=$apiVersion;
	}

	public function getApiVersion()
	{
		return $this->apiVersion;
	}

  public function setNeedEncrypt($needEncrypt)
  {

     $this->needEncrypt=$needEncrypt;

  }

  public function getNeedEncrypt()
  {
    return $this->needEncrypt;
  }

}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.codename.model.user;

import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 *
 * @author grogdj
 */
@Entity(name = "LoginRecord")
@Table(name = "LOGINRECORD")
public class LoginRecord {

    private User user;
    private Date logTime;
}


text:
package org.apache.deltaspike.security.impl.extension;

import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Stereotype;
import javax.enterprise.inject.Typed;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.AnnotatedParameter;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.util.Nonbinding;
import javax.interceptor.InvocationContext;

import org.apache.deltaspike.core.util.metadata.builder.InjectableMethod;
import org.apache.deltaspike.security.api.authorization.AccessDeniedException;
import org.apache.deltaspike.security.api.authorization.SecurityBindingType;
import org.apache.deltaspike.security.api.authorization.SecurityDefinitionException;
import org.apache.deltaspike.security.api.authorization.SecurityViolation;
import org.apache.deltaspike.security.api.authorization.SecuredReturn;
import org.apache.deltaspike.security.impl.authorization.SecurityParameterValueRedefiner;
import org.apache.deltaspike.security.impl.util.SecurityUtils;

/**
 * Responsible for authorizing method invocations.
 */
@Typed()
class Authorizer
{
    private Annotation bindingAnnotation;
    private Map<Method, Object> bindingSecurityBindingMembers = new HashMap<Method, Object>();
    private Set<AuthorizationParameter> authorizationParameters = new HashSet<AuthorizationParameter>();
    private Class<?> securedReturnType;

    private volatile AnnotatedMethod<?> boundAuthorizerMethod;
    private volatile Bean<?> boundAuthorizerBean;

    private volatile InjectableMethod<?> boundAuthorizerMethodProxy;

    Authorizer(Annotation bindingAnnotation, AnnotatedMethod<?> boundAuthorizerMethod)
    {
        this.bindingAnnotation = bindingAnnotation;
        this.boundAuthorizerMethod = boundAuthorizerMethod;

        try
        {
            for (Method method : bindingAnnotation.annotationType().getDeclaredMethods())
            {
                if (method.isAnnotationPresent(Nonbinding.class))
                {
                    continue;
                }
                bindingSecurityBindingMembers.put(method, method.invoke(bindingAnnotation));
            }
        }
        catch (InvocationTargetException ex)
        {
            throw new SecurityDefinitionException("Error reading security binding members", ex);
        }
        catch (IllegalAccessException ex)
        {
            throw new SecurityDefinitionException("Error reading security binding members", ex);
        }

        for (AnnotatedParameter<?> annotatedParameter : boundAuthorizerMethod.getParameters())
        {
            Set<Annotation> securityParameterBindings = null;
            Class<?> securedReturnType = null;
            for (Annotation annotation : annotatedParameter.getAnnotations())
            {
                if (SecurityUtils.isMetaAnnotatedWithSecurityParameterBinding(annotation))
                {
                    if (securityParameterBindings == null)
                    {
                        securityParameterBindings = new HashSet<Annotation>();
                    }
                    securityParameterBindings.add(annotation);
                }
                if (annotation.annotationType().equals(SecuredReturn.class))
                {
                    securedReturnType
                        = boundAuthorizerMethod.getJavaMember().getParameterTypes()[annotatedParameter.getPosition()];
                }
            }
            if (securityParameterBindings != null && securedReturnType != null)
            {
                StringBuilder errorMessage = new StringBuilder();
                errorMessage.append("@SecurityParameterBinding annotations must not occure ");
                errorMessage.append("at the same parameter with @Result annotation, but parameter ");
                errorMessage.append(annotatedParameter.getPosition()).append(" of method ");
                errorMessage.append(boundAuthorizerMethod.getJavaMember()).append(" is annotated with @Result and ");
                boolean first = true;
                for (Annotation securityParameterBinding : securityParameterBindings)
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        errorMessage.append(" and ");
                    }
                    errorMessage.append(securityParameterBinding);
                }
                if (securityParameterBindings.size() == 1)
                {
                    errorMessage.append(", which is a @SecurityParameterBinding annotation");
                }
                else
                {
                    errorMessage.append(", which are @SecurityParameterBinding annotations");
                }
                throw new SecurityDefinitionException(errorMessage.toString());
            }
            else if (securityParameterBindings != null)
            {
                AuthorizationParameter authorizationParameter
                    = new AuthorizationParameter(annotatedParameter.getBaseType(), securityParameterBindings);
                authorizationParameters.add(authorizationParameter);
            }
            else if (securedReturnType != null)
            {
                if (this.securedReturnType != null
                    && !this.securedReturnType.equals(securedReturnType))
                {
                    throw new SecurityDefinitionException("More than one parameter of "
                                                          + boundAuthorizerMethod.getJavaMember()
                                                          + " is annotated with @Result");
                }
                this.securedReturnType = securedReturnType;
            }
        }
    }

    boolean isBeforeMethodInvocationAuthorizer()
    {
        return securedReturnType == null;
    }

    boolean isAfterMethodInvocationAuthorizer()
    {
        return securedReturnType != null;
    }

    void authorize(final InvocationContext ic, final Object returnValue, BeanManager beanManager)
        throws IllegalAccessException, IllegalArgumentException
    {
        if (boundAuthorizerBean == null)
        {
            lazyInitTargetBean(beanManager);
        }

        final CreationalContext<?> creationalContext = beanManager.createCreationalContext(boundAuthorizerBean);

        Object reference = beanManager.getReference(boundAuthorizerBean,
            boundAuthorizerMethod.getJavaMember().getDeclaringClass(), creationalContext);

        Object result = boundAuthorizerMethodProxy.invoke(reference, creationalContext,
                new SecurityParameterValueRedefiner(creationalContext, ic, returnValue));

        if (Boolean.FALSE.equals(result))
        {
            Set<SecurityViolation> violations = new HashSet<SecurityViolation>();
            violations.add(new SecurityViolation()
            {
                private static final long serialVersionUID = 2358753444038521129L;

                @Override
                public String getReason()
                {
                    return "Authorization check failed";
                }
            });

            throw new AccessDeniedException(violations);
        }
    }

    @SuppressWarnings({ "unchecked" })
    private synchronized void lazyInitTargetBean(BeanManager beanManager)
    {
        if (boundAuthorizerBean == null)
        {
            Method method = boundAuthorizerMethod.getJavaMember();

            Set<Bean<?>> beans = beanManager.getBeans(method.getDeclaringClass());
            boundAuthorizerBean = beanManager.resolve(beans);

            if (boundAuthorizerBean == null)
            {
                throw new IllegalStateException("Exception looking up authorizer method bean - " +
                        "no beans found for method [" + method.getDeclaringClass() + "." +
                        method.getName() + "]");
            }

            boundAuthorizerMethodProxy = new InjectableMethod(boundAuthorizerMethod, boundAuthorizerBean, beanManager);
        }
    }

    boolean matchesBindings(Annotation annotation, Set<AuthorizationParameter> parameterBindings, Class<?> returnType)
    {
        if (!annotation.annotationType().isAnnotationPresent(SecurityBindingType.class) &&
                annotation.annotationType().isAnnotationPresent(Stereotype.class))
        {
            annotation = SecurityUtils.resolveSecurityBindingType(annotation);
        }

        if (!annotation.annotationType().equals(bindingAnnotation.annotationType()))
        {
            return false;
        }

        for (Method method : annotation.annotationType().getDeclaredMethods())
        {
            if (method.isAnnotationPresent(Nonbinding.class))
            {
                continue;
            }

            if (!bindingSecurityBindingMembers.containsKey(method))
            {
                return false;
            }

            try
            {
                Object value = method.invoke(annotation);
                if (!bindingSecurityBindingMembers.get(method).equals(value))
                {
                    return false;
                }
            }
            catch (InvocationTargetException ex)
            {
                throw new SecurityDefinitionException("Error reading security binding members", ex);
            }
            catch (IllegalAccessException ex)
            {
                throw new SecurityDefinitionException("Error reading security binding members", ex);
            }
        }

        for (AuthorizationParameter authorizationParameter : authorizationParameters)
        {
            boolean found = false;
            for (AuthorizationParameter parameterBinding : parameterBindings)
            {
                if (parameterBinding.matches(authorizationParameter))
                {
                    found = true;
                }
            }
            if (!found)
            {
                return false;
            }
        }

        if (!matches(returnType))
        {
            return false;
        }

        return true;
    }

    private boolean matches(Class<?> returnType)
    {
        if (securedReturnType == null)
        {
            return true;
        }
        if (securedReturnType.isAssignableFrom(returnType))
        {
            return true;
        }
        if (securedReturnType.equals(Void.class) && returnType.equals(Void.TYPE))
        {
            return true;
        }
        return false;
    }

    Method getBoundAuthorizerMethod()
    {
        return boundAuthorizerMethod.getJavaMember();
    }
}


text:
layout: page
title: Past
subtitle:
---

Results

Results


text:
<?php

namespace EssentialTv\EtvBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * CharacterSeasonEpisode
 */
class CharacterSeasonEpisode
{
    /**
     * @var integer
     */
    private $cseCharacterId;

    /**
     * @var integer
     */
    private $cseSeasonId;

    /**
     * @var integer
     */
    private $cseEpisodeId;

    /**
     * @var integer
     */
    private $cseApperanceCount;

    /**
     * @var \DateTime
     */
    private $cseCreatedOn;

    /**
     * @var integer
     */
    private $cseCreatedBy;

    /**
     * @var \DateTime
     */
    private $cseUpdatedOn;

    /**
     * @var integer
     */
    private $cseUpdatedBy;

    /**
     * @var integer
     */
    private $cseId;

    /**
     * Set cseCharacterId
     *
     * @param integer $cseCharacterId
     * @return CharacterSeasonEpisode
     */
    public function setCseCharacterId($cseCharacterId)
    {
        $this->cseCharacterId = $cseCharacterId;

        return $this;
    }

    /**
     * Get cseCharacterId
     *
     * @return integer
     */
    public function getCseCharacterId()
    {
        return $this->cseCharacterId;
    }

    /**
     * Set cseSeasonId
     *
     * @param integer $cseSeasonId
     * @return CharacterSeasonEpisode
     */
    public function setCseSeasonId($cseSeasonId)
    {
        $this->cseSeasonId = $cseSeasonId;

        return $this;
    }

    /**
     * Get cseSeasonId
     *
     * @return integer
     */
    public function getCseSeasonId()
    {
        return $this->cseSeasonId;
    }

    /**
     * Set cseEpisodeId
     *
     * @param integer $cseEpisodeId
     * @return CharacterSeasonEpisode
     */
    public function setCseEpisodeId($cseEpisodeId)
    {
        $this->cseEpisodeId = $cseEpisodeId;

        return $this;
    }

    /**
     * Get cseEpisodeId
     *
     * @return integer
     */
    public function getCseEpisodeId()
    {
        return $this->cseEpisodeId;
    }

    /**
     * Set cseApperanceCount
     *
     * @param integer $cseApperanceCount
     * @return CharacterSeasonEpisode
     */
    public function setCseApperanceCount($cseApperanceCount)
    {
        $this->cseApperanceCount = $cseApperanceCount;

        return $this;
    }

    /**
     * Get cseApperanceCount
     *
     * @return integer
     */
    public function getCseApperanceCount()
    {
        return $this->cseApperanceCount;
    }

    /**
     * Set cseCreatedOn
     *
     * @param \DateTime $cseCreatedOn
     * @return CharacterSeasonEpisode
     */
    public function setCseCreatedOn($cseCreatedOn)
    {
        $this->cseCreatedOn = $cseCreatedOn;

        return $this;
    }

    /**
     * Get cseCreatedOn
     *
     * @return \DateTime
     */
    public function getCseCreatedOn()
    {
        return $this->cseCreatedOn;
    }

    /**
     * Set cseCreatedBy
     *
     * @param integer $cseCreatedBy
     * @return CharacterSeasonEpisode
     */
    public function setCseCreatedBy($cseCreatedBy)
    {
        $this->cseCreatedBy = $cseCreatedBy;

        return $this;
    }

    /**
     * Get cseCreatedBy
     *
     * @return integer
     */
    public function getCseCreatedBy()
    {
        return $this->cseCreatedBy;
    }

    /**
     * Set cseUpdatedOn
     *
     * @param \DateTime $cseUpdatedOn
     * @return CharacterSeasonEpisode
     */
    public function setCseUpdatedOn($cseUpdatedOn)
    {
        $this->cseUpdatedOn = $cseUpdatedOn;

        return $this;
    }

    /**
     * Get cseUpdatedOn
     *
     * @return \DateTime
     */
    public function getCseUpdatedOn()
    {
        return $this->cseUpdatedOn;
    }

    /**
     * Set cseUpdatedBy
     *
     * @param integer $cseUpdatedBy
     * @return CharacterSeasonEpisode
     */
    public function setCseUpdatedBy($cseUpdatedBy)
    {
        $this->cseUpdatedBy = $cseUpdatedBy;

        return $this;
    }

    /**
     * Get cseUpdatedBy
     *
     * @return integer
     */
    public function getCseUpdatedBy()
    {
        return $this->cseUpdatedBy;
    }

    /**
     * Get cseId
     *
     * @return integer
     */
    public function getCseId()
    {
        return $this->cseId;
    }
}


text:
using System;
using System.Drawing;
using BASeCamp.BASeBlock.Blocks;

namespace BASeCamp.BASeBlock.Powerups
{
    public class BlockRandomizerPowerup : GamePowerUp
    {
        private static Type[] PossibleTypes = new Type[] {typeof(NormalBlock),typeof(StrongBlock),typeof(PowerupBlock),typeof(PowerupCycleBlock),
                                                          typeof(InvincibleBlock),typeof(RayBlock),typeof(VomitBlock)};
        public bool Callback(BCBlockGameState gamestate)
        {
            BCBlockGameState.Soundman.PlaySound("RANDOMY");
            int numchange = Math.Min(BCBlockGameState.rgen.Next(4, 10),gamestate.Blocks.Count);

            for (int i = 0; i < numchange; i++)
            {
                bool err = true;
                while (err)
                {
                    try
                    {
                        //choose a random block...
                        Block chosenblock = BCBlockGameState.Choose(gamestate.Blocks);
                        //choose a random block type to replace it with.
                        //Type replacewith = BCBlockGameState.Choose(BCBlockGameState.BlockTypes.ManagedTypes);
                        Type replacewith = BCBlockGameState.Choose(PossibleTypes);
                        Block createdblock = (Block)Activator.CreateInstance(replacewith, chosenblock.BlockRectangle);

                        //remove the old block...
                        gamestate.Blocks.Remove(chosenblock);
                        //add the new one (the "swapped" one...
                        gamestate.Blocks.AddLast(createdblock);
                        //set refresh variable to tell the paint routine that it has to refresh the blocks.

                        err = false;
                    }
                    catch
                    {
                        err = true;

                    }
                    //create the new block. remember, block constructor is a single RectangleF. catch errors
                }

            }
            gamestate.Forcerefresh = true;
            gamestate.NextFrameCalls.Enqueue(new BCBlockGameState.NextFrameStartup((a, q) => { gamestate.Forcerefresh = true; return true; },null));

            return true;
        }
        public static float PowerupChance()
        {
            return 1f;
        }
        public BlockRandomizerPowerup(PointF pLocation, SizeF psize)
            : base(pLocation, psize, new Image[] { BCBlockGameState.Imageman.getLoadedImage("COLOURIZE(255,255,0,255):RANDOMIZER") }, 10, null)
        {

            usefunction = Callback;
        }
    }
}


text:
'use strict';

/**
 * expand-range
 */

module.exports = require('../..');


text: ticker ticker::s_instance;


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Short File Description
 *
 * PHP version 5
 *
 * @category   aCategory
 * @package    aPackage
 * @subpackage aSubPackage
 * @author     anAuthor
 * @copyright  2014 a Copyright
 * @license    a License
 * @link       http://www.aLink.com
 */

namespace Blockchain;

use \Blockchain\Exception\Error;
use \Blockchain\Exception\ApiError;
use \Blockchain\Exception\HttpError;

use \Blockchain\Create\Create;
use \Blockchain\Explorer\Explorer;
use \Blockchain\PushTX\Push;
use \Blockchain\Rates\Rates;
use \Blockchain\Stats\Stats;
use \Blockchain\Wallet\Wallet;

use \Blockchain\V2\Receive\Receive as ReceiveV2;

// Check if BCMath module installed
if(!function_exists('bcscale')) {
    throw new Error("BC Math module not installed.");
}

// Check if curl module installed
if(!function_exists('curl_init')) {
    throw new Error("cURL module not installed.");
}

class Blockchain {
    const URL = 'https://blockchain.info/';

    private $ch;
    private $api_code = null;

    const DEBUG = true;
    public $log = Array();

    public function __construct($api_code=null) {
        $this->service_url = null;

        if(!is_null($api_code)) {
            $this->api_code = $api_code;
        }

        $this->ch = curl_init();
        curl_setopt($this->ch, CURLOPT_USERAGENT, 'Blockchain-PHP/1.0');
        curl_setopt($this->ch, CURLOPT_HEADER, false);
        curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 30);
        curl_setopt($this->ch, CURLOPT_TIMEOUT, 60);
        curl_setopt($this->ch, CURLOPT_CAINFO, dirname(__FILE__).'/Blockchain/ca-bundle.crt');

        $this->Create    = new Create($this);
        $this->Explorer  = new Explorer($this);
        $this->Push      = new Push($this);
        $this->Rates     = new Rates($this);
        $this->ReceiveV2 = new ReceiveV2($this->ch);
        $this->Stats     = new Stats($this);
        $this->Wallet    = new Wallet($this);
    }

    public function __destruct() {
        curl_close($this->ch);
    }

    public function setTimeout($timeout) {
        curl_setopt($this->ch, CURLOPT_TIMEOUT, intval($timeout));
    }

    public function setServiceUrl($service_url) {
        if (substr($service_url, -1, 1) != '/'){
            $service_url = $service_url . '/';
        }
        $this->service_url = $service_url;
    }

    public function post($resource, $data=null) {
        $url = Blockchain::URL;

        if (($resource == "api/v2/create") || (substr($resource, 0, 8) === "merchant")) {
            if ($this->service_url == null) {
                throw new ApiError("When calling a merchant endpoint or creating a wallet, service_url must be set");
            }
            $url = $this->service_url;
        }

        curl_setopt($this->ch, CURLOPT_URL, $url.$resource);
        curl_setopt($this->ch, CURLOPT_POST, true);

        curl_setopt($this->ch, CURLOPT_HTTPHEADER,
            array("Content-Type: application/x-www-form-urlencoded"));

        if(!is_null($this->api_code)) {
            $data['api_code'] = $this->api_code;
        }

        curl_setopt($this->ch, CURLOPT_POSTFIELDS, http_build_query($data));

        $json = $this->_call();

        // throw ApiError if we get an 'error' field in the JSON
        if(array_key_exists('error', $json)) {
            throw new ApiError($json['error']);
        }

        return $json;
    }

    public function get($resource, $params=array()) {
        $url = Blockchain::URL;

        if (($resource == "api/v2/create") || (substr($resource, 0, 8) === "merchant")) {
            $url = SERVICE_URL;
        }

        curl_setopt($this->ch, CURLOPT_POST, false);

        if(!is_null($this->api_code)) {
            $params['api_code'] = $this->api_code;
        }
        curl_setopt($this->ch, CURLOPT_HTTPHEADER, array());

        $query = http_build_query($params);
        curl_setopt($this->ch, CURLOPT_URL, $url.$resource.'?'.$query);

        return $this->_call();
    }

    private function _call() {
        $t0 = microtime(true);
        $response = curl_exec($this->ch);
        $dt = microtime(true) - $t0;

        if(curl_error($this->ch)) {
            $info = curl_getinfo($this->ch);
            throw new HttpError("Call to " . $info['url'] . " failed: " . curl_error($this->ch));
        }
        $json = json_decode($response, true);
        if(is_null($json)) {
            // this is possibly a from btc request with a comma separation
            $json = json_decode(str_replace(',', '', $response));
            if (is_null($json))
                throw new Error("Unable to decode JSON response from Blockchain: " . $response);
        }

        if(self::DEBUG) {
            $info = curl_getinfo($this->ch);
            $this->log[] = array(
                'curl_info' => $info,
                'elapsed_ms' => round(1000*$dt)
            );
        }

        return $json;
    }
}


text:
RgCheckBox::RgCheckBox(QWidget* parent) : QCheckBox(parent)
{
}

void RgCheckBox::focusInEvent(QFocusEvent* event)
{
    emit CheckBoxFocusInEvent();

    // Pass the event onto the base class.
    QCheckBox::focusInEvent(event);
}

void RgCheckBox::focusOutEvent(QFocusEvent* event)
{
    emit CheckBoxFocusOutEvent();

    // Pass the event onto the base class.
    QCheckBox::focusOutEvent(event);
}

void RgCheckBox::mouseMoveEvent(QMouseEvent* event)
{
    // Get the widget name.
    QString widgetName = this->objectName();

    // Set tooltip for the widget hovered over.
    QString tooltip = TOOLTIPS[widgetName];

    // Display the tooltip.
    QToolTip::showText(event->globalPos(), tooltip);

    // Pass the event onto the base class.
    QCheckBox::mouseMoveEvent(event);
}


text:
/*
  This is an example factory definition.

  Create more files in this directory to define additional factories.
*/
import { Factory, faker } from 'ember-cli-mirage';

export default Factory.extend({

  // age: 20,                              // numbers
  // tall: true,                           // booleans

  // email: function(i) {                  // and functions
  //   return 'person' + i + '@test.com';
  // },

  // zipCode: faker.address         .zipCode
});


text:
<?php
$page_title = "Home";
include("includes/header.php");?>
      <!-- index.php -->
<?php include("includes/footer.php");?>


text:
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { GameService } from '../shared/services/game.service';
import { Game } from '../shared/models/game.model';
import { NotificationService } from '../shared/services/notification.service';

@Component({
  moduleId: module.id,
  selector: 'agot-game-details',
  templateUrl: 'game-details.component.html',
})
export class GameDetailsComponent implements OnInit {
  game: Game;

  editing: boolean = false;
  formDisabled: boolean = false;
  isLoading: boolean;
  loadError: any = null;

  constructor(private _route: ActivatedRoute,
              private gameService: GameService,
              private notificationService: NotificationService) {
  }

  ngOnInit() {
    this._route.params
      .do(() => this.isLoading = true)
      .switchMap((params: Params) => this.gameService.getGame(+params['id']))
      .subscribe(
        (game) => {
          this.isLoading = false;
          return this.game = game;
        },
        (error) => {
          this.isLoading = false;
          return this.loadError = error;
        },
        () => this.isLoading = false
      );
  }

  onSubmit(game: Game) {
    this.formDisabled = true;
    this.isLoading = true;

    console.log('details submit', game);
    // TODO if creating, redirect to /game/id on submit?
    this.gameService.updateGame(game).subscribe((game: Game) => {
        this.game = game;
        this.formDisabled = false;
        this.editing = false;
      }, (error) => {
        this.formDisabled = false;
        console.error(error);
        this.notificationService.error('Whoops', error.message || error._body || error);
        this.isLoading = false;
      }, () => this.isLoading = false
    );
  }

  onCancel() {
    this.editing = false;
  }

  onEdit() {
    this.editing = true;
  }

  onDelete() {
    console.log('delete', this.game);
    this.gameService.deleteGame(this.game.gameId).subscribe((result) => {
      this.game = null;
      this.notificationService.success('There', `I hope you're happy`);
    }, (error) => {
      console.error(error);
      this.notificationService.error('Whoops', error.message || error._body || error);
    });
  }

}