Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11468


Ignore:
Timestamp:
10/16/14 03:57:49 (10 years ago)
Author:
swagner
Message:

#2205: Worked on optimization networks

Location:
branches/OptimizationNetworks
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ClientNodeView.Designer.cs

    r11465 r11468  
    4848      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
    4949      this.portsTabPage = new System.Windows.Forms.TabPage();
    50       this.callsTabPage = new System.Windows.Forms.TabPage();
     50      this.serviceCallsTabPage = new System.Windows.Forms.TabPage();
    5151      this.serviceParameterCollectionCollectionView = new HeuristicLab.Optimization.Networks.Views.ServiceParameterCollectionCollectionView();
    52       this.callButton = new System.Windows.Forms.Button();
     52      this.callServicesButton = new System.Windows.Forms.Button();
     53      this.cancelServicesButton = new System.Windows.Forms.Button();
    5354      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5455      this.tabControl.SuspendLayout();
    5556      this.portsTabPage.SuspendLayout();
    56       this.callsTabPage.SuspendLayout();
     57      this.serviceCallsTabPage.SuspendLayout();
    5758      this.SuspendLayout();
    5859      //
     
    8384            | System.Windows.Forms.AnchorStyles.Right)));
    8485      this.tabControl.Controls.Add(this.portsTabPage);
    85       this.tabControl.Controls.Add(this.callsTabPage);
     86      this.tabControl.Controls.Add(this.serviceCallsTabPage);
    8687      this.tabControl.Location = new System.Drawing.Point(0, 63);
    8788      this.tabControl.Name = "tabControl";
    8889      this.tabControl.SelectedIndex = 0;
    8990      this.tabControl.Size = new System.Drawing.Size(645, 454);
    90       this.tabControl.TabIndex = 4;
     91      this.tabControl.TabIndex = 5;
    9192      //
    9293      // portsTabPage
     
    101102      this.portsTabPage.UseVisualStyleBackColor = true;
    102103      //
    103       // callsTabPage
     104      // serviceCallsTabPage
    104105      //
    105       this.callsTabPage.Controls.Add(this.serviceParameterCollectionCollectionView);
    106       this.callsTabPage.Location = new System.Drawing.Point(4, 22);
    107       this.callsTabPage.Name = "callsTabPage";
    108       this.callsTabPage.Size = new System.Drawing.Size(637, 428);
    109       this.callsTabPage.TabIndex = 2;
    110       this.callsTabPage.Text = "Calls";
    111       this.callsTabPage.UseVisualStyleBackColor = true;
     106      this.serviceCallsTabPage.Controls.Add(this.serviceParameterCollectionCollectionView);
     107      this.serviceCallsTabPage.Location = new System.Drawing.Point(4, 22);
     108      this.serviceCallsTabPage.Name = "serviceCallsTabPage";
     109      this.serviceCallsTabPage.Size = new System.Drawing.Size(637, 428);
     110      this.serviceCallsTabPage.TabIndex = 2;
     111      this.serviceCallsTabPage.Text = "Service Calls";
     112      this.serviceCallsTabPage.UseVisualStyleBackColor = true;
    112113      //
    113114      // serviceParameterCollectionCollectionView
     
    125126      this.serviceParameterCollectionCollectionView.TabIndex = 0;
    126127      //
    127       // callButton
     128      // callServicesButton
    128129      //
    129       this.callButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    130             | System.Windows.Forms.AnchorStyles.Right)));
    131       this.callButton.Location = new System.Drawing.Point(69, 26);
    132       this.callButton.Name = "callButton";
    133       this.callButton.Size = new System.Drawing.Size(551, 23);
    134       this.callButton.TabIndex = 3;
    135       this.callButton.Text = "&Call Services";
    136       this.callButton.UseVisualStyleBackColor = true;
    137       this.callButton.Click += new System.EventHandler(this.callButton_Click);
     130      this.callServicesButton.Location = new System.Drawing.Point(69, 26);
     131      this.callServicesButton.Name = "callServicesButton";
     132      this.callServicesButton.Size = new System.Drawing.Size(101, 23);
     133      this.callServicesButton.TabIndex = 3;
     134      this.callServicesButton.Text = "&Call Services";
     135      this.callServicesButton.UseVisualStyleBackColor = true;
     136      this.callServicesButton.Click += new System.EventHandler(this.callServicesButton_Click);
     137      //
     138      // cancelServicesButton
     139      //
     140      this.cancelServicesButton.Location = new System.Drawing.Point(176, 26);
     141      this.cancelServicesButton.Name = "cancelServicesButton";
     142      this.cancelServicesButton.Size = new System.Drawing.Size(101, 23);
     143      this.cancelServicesButton.TabIndex = 4;
     144      this.cancelServicesButton.Text = "&Cancel Services";
     145      this.cancelServicesButton.UseVisualStyleBackColor = true;
     146      this.cancelServicesButton.Click += new System.EventHandler(this.cancelServicesButton_Click);
    138147      //
    139148      // ClientNodeView
    140149      //
    141150      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    142       this.Controls.Add(this.callButton);
     151      this.Controls.Add(this.cancelServicesButton);
     152      this.Controls.Add(this.callServicesButton);
    143153      this.Controls.Add(this.tabControl);
    144154      this.Name = "ClientNodeView";
     
    147157      this.Controls.SetChildIndex(this.infoLabel, 0);
    148158      this.Controls.SetChildIndex(this.tabControl, 0);
    149       this.Controls.SetChildIndex(this.callButton, 0);
     159      this.Controls.SetChildIndex(this.callServicesButton, 0);
     160      this.Controls.SetChildIndex(this.cancelServicesButton, 0);
    150161      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    151162      this.tabControl.ResumeLayout(false);
    152163      this.portsTabPage.ResumeLayout(false);
    153       this.callsTabPage.ResumeLayout(false);
     164      this.serviceCallsTabPage.ResumeLayout(false);
    154165      this.ResumeLayout(false);
    155166      this.PerformLayout();
     
    162173    protected System.Windows.Forms.TabPage portsTabPage;
    163174    protected HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;
    164     protected System.Windows.Forms.TabPage callsTabPage;
     175    protected System.Windows.Forms.TabPage serviceCallsTabPage;
    165176    protected ServiceParameterCollectionCollectionView serviceParameterCollectionCollectionView;
    166     protected System.Windows.Forms.Button callButton;
     177    protected System.Windows.Forms.Button callServicesButton;
     178    protected System.Windows.Forms.Button cancelServicesButton;
    167179
    168180
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ClientNodeView.cs

    r11465 r11468  
    2020#endregion
    2121
    22 using HeuristicLab.Core.Views;
    2322using HeuristicLab.MainForm;
    24 using HeuristicLab.PluginInfrastructure;
    2523using System;
     24using System.Threading;
    2625using System.Windows.Forms;
    2726
     
    3130  [Content(typeof(IClientNode), false)]
    3231  public partial class ClientNodeView : EntityView {
     32    protected CancellationTokenSource tokenSource = new CancellationTokenSource();
     33
    3334    public new IClientNode Content {
    3435      get { return (IClientNode)base.Content; }
     
    5354    protected override void SetEnabledStateOfControls() {
    5455      base.SetEnabledStateOfControls();
    55       callButton.Enabled = Content != null && !ReadOnly;
     56      callServicesButton.Enabled = Content != null && !ReadOnly;
    5657      portCollectionView.Enabled = Content != null && !ReadOnly;
    5758      serviceParameterCollectionCollectionView.Enabled = Content != null && !ReadOnly;
    5859    }
    5960
    60     protected virtual void callButton_Click(object sender, EventArgs e) {
    61       Content.CallAsync();
     61    protected virtual void callServicesButton_Click(object sender, EventArgs e) {
     62      Content.CallServicesAsync(tokenSource.Token);
     63    }
     64    protected virtual void cancelServicesButton_Click(object sender, EventArgs e) {
     65      tokenSource.Cancel();
    6266    }
    6367  }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj

    r11465 r11468  
    1010    <RootNamespace>HeuristicLab.Optimization.Networks.Views</RootNamespace>
    1111    <AssemblyName>HeuristicLab.Optimization.Networks.Views-3.3</AssemblyName>
    12     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     12    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1313    <FileAlignment>512</FileAlignment>
    1414    <TargetFrameworkProfile />
     
    2222    <ErrorReport>prompt</ErrorReport>
    2323    <WarningLevel>4</WarningLevel>
     24    <Prefer32Bit>false</Prefer32Bit>
    2425  </PropertyGroup>
    2526  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    3031    <ErrorReport>prompt</ErrorReport>
    3132    <WarningLevel>4</WarningLevel>
     33    <Prefer32Bit>false</Prefer32Bit>
    3234  </PropertyGroup>
    3335  <PropertyGroup>
     
    4547    <ErrorReport>prompt</ErrorReport>
    4648    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     49    <Prefer32Bit>false</Prefer32Bit>
    4750  </PropertyGroup>
    4851  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     
    5457    <ErrorReport>prompt</ErrorReport>
    5558    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     59    <Prefer32Bit>false</Prefer32Bit>
    5660  </PropertyGroup>
    5761  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     
    6367    <ErrorReport>prompt</ErrorReport>
    6468    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     69    <Prefer32Bit>false</Prefer32Bit>
    6570  </PropertyGroup>
    6671  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     
    7277    <ErrorReport>prompt</ErrorReport>
    7378    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     79    <Prefer32Bit>false</Prefer32Bit>
    7480  </PropertyGroup>
    7581  <ItemGroup>
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/AlgorithmServiceNode.cs

    r11465 r11468  
    9393    }
    9494
    95     protected virtual void Execute(ServiceParameterCollection parameters) {
     95    protected virtual void Execute(ServiceParameterCollection parameters, CancellationToken token) {
    9696      if (Template == null) throw new InvalidOperationException("Template is null");
    9797
     
    120120      algorithm.Stopped += Algorithm_Stopped;
    121121      algorithm.Start();
    122       waitHandles[algorithm].WaitOne();
    123 
    124       // retrieve results
    125       foreach (var p in parameters.Where(x => x.Type == ServiceParameterType.Output)) {
    126         IResult result = null;
    127         if (algorithm.Results.TryGetValue(p.Name, out result)) {
    128           p.Value = result.Value;
    129         }
    130       }
    131 
    132       lock (locker) {
    133         waitHandles[algorithm].Dispose();
    134         waitHandles.Remove(algorithm);
    135         Runs.Add(algorithm.Runs.ToArray()[0]);
     122      if (WaitHandle.WaitAny(new WaitHandle[] { waitHandles[algorithm], token.WaitHandle }) == 1) {
     123        // retrieve results
     124        foreach (var p in parameters.Where(x => x.Type == ServiceParameterType.Output)) {
     125          IResult result = null;
     126          if (algorithm.Results.TryGetValue(p.Name, out result)) {
     127            p.Value = result.Value;
     128          }
     129        }
     130
     131        lock (locker) {
     132          waitHandles[algorithm].Dispose();
     133          waitHandles.Remove(algorithm);
     134          Runs.Add(algorithm.Runs.ToArray()[0]);
     135        }
     136      } else {  // cancellation
     137        algorithm.Stop();
     138        lock (locker) {
     139          waitHandles[algorithm].Dispose();
     140          waitHandles.Remove(algorithm);
     141        }
    136142      }
    137143    }
     
    191197      IServicePort s = port as IServicePort;
    192198      if (s != null) {
    193         s.Called += ServicePort_Called;
     199        s.ProcessParameters += ServicePort_ProcessParameters;
    194200      }
    195201    }
     
    203209      IServicePort s = port as IServicePort;
    204210      if (s != null) {
    205         s.Called -= ServicePort_Called;
     211        s.ProcessParameters -= ServicePort_ProcessParameters;
    206212      }
    207213    }
     
    212218      UpdateParameter((IInputPort)sender);
    213219    }
    214     private void ServicePort_Called(object sender, EventArgs<ServiceParameterCollection> e) {
    215       Execute(e.Value);
     220    private void ServicePort_ProcessParameters(object sender, EventArgs<ServiceParameterCollection, CancellationToken> e) {
     221      Execute(e.Value, e.Value2);
    216222    }
    217223    #endregion
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/ClientNode.cs

    r11465 r11468  
    6868    }
    6969
    70     public virtual void CallAsync() {
    71       Task.Factory.StartNew(() => {
     70    public virtual async Task CallServicesAsync() {
     71      await CallServicesAsync(new CancellationToken());
     72    }
     73    public virtual async Task CallServicesAsync(CancellationToken token) {
     74      foreach (var clientPort in Ports.OfType<IClientPort>()) {
     75        var parameters = clientPort.PrepareParameters();
    7276
    73         foreach (var clientPort in Ports.OfType<IClientPort>()) {
    74           var parameters = clientPort.PrepareParameters();
     77        // retrieve inputs
     78        foreach (var inputPort in Ports.OfType<IInputPort>().
     79                                        Where(x => parameters.ContainsKey(x.Name) &&
     80                                                    parameters[x.Name].Type == ServiceParameterType.Input &&
     81                                                    parameters[x.Name].DataType.IsAssignableFrom(x.DataType))) {
     82          parameters[inputPort.Name].Value = (IItem)inputPort.Value.Clone();
     83        }
    7584
    76           // retrieve inputs
    77           foreach (var inputPort in Ports.OfType<IInputPort>().
    78                                           Where(x => parameters.ContainsKey(x.Name) &&
    79                                                      parameters[x.Name].Type == ServiceParameterType.Input &&
    80                                                      parameters[x.Name].DataType.IsAssignableFrom(x.DataType))) {
    81             parameters[inputPort.Name].Value = (IItem)inputPort.Value.Clone();
     85        parameters = await clientPort.CallServiceAsync(parameters, token);
     86
     87        lock (locker) {
     88          // set outputs
     89          foreach (var outputPort in Ports.OfType<IOutputPort>().
     90                                            Where(x => parameters.ContainsKey(x.Name) &&
     91                                                      parameters[x.Name].Type == ServiceParameterType.Output &&
     92                                                      x.DataType.IsAssignableFrom(parameters[x.Name].DataType))) {
     93            outputPort.Value = (IItem)parameters[outputPort.Name].Value.Clone();
    8294          }
    8395
    84           parameters = clientPort.Call(parameters);
    85 
    86           lock (locker) {
    87             // set outputs
    88             foreach (var outputPort in Ports.OfType<IOutputPort>().
    89                                              Where(x => parameters.ContainsKey(x.Name) &&
    90                                                         parameters[x.Name].Type == ServiceParameterType.Output &&
    91                                                         x.DataType.IsAssignableFrom(parameters[x.Name].DataType))) {
    92               outputPort.Value = (IItem)parameters[outputPort.Name].Value.Clone();
    93             }
    94 
    95             Calls.Add(parameters);
    96           }
     96          Calls.Add(parameters);
    9797        }
    98       });
     98      }
    9999    }
    100100  }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/ClientPort.cs

    r11454 r11468  
    2626using System.Drawing;
    2727using System.Linq;
     28using System.Threading;
     29using System.Threading.Tasks;
    2830
    2931namespace HeuristicLab.Optimization.Networks {
     
    127129      return parameters;
    128130    }
    129     public ServiceParameterCollection Call(ServiceParameterCollection parameters) {
     131    public ServiceParameterCollection CallService(ServiceParameterCollection parameters) {
    130132      if (!Valid) throw new InvalidOperationException("Port configurations do not match");
    131       return ServicePort.Call(parameters);
     133      return ServicePort.Process(parameters);
     134    }
     135    public ServiceParameterCollection CallService(ServiceParameterCollection parameters, CancellationToken token) {
     136      if (!Valid) throw new InvalidOperationException("Port configurations do not match");
     137      return ServicePort.Process(parameters, token);
     138    }
     139    public async Task<ServiceParameterCollection> CallServiceAsync(ServiceParameterCollection parameters) {
     140      if (!Valid) throw new InvalidOperationException("Port configurations do not match");
     141      return await ServicePort.ProcessAsync(parameters);
     142    }
     143    public async Task<ServiceParameterCollection> CallServiceAsync(ServiceParameterCollection parameters, CancellationToken token) {
     144      if (!Valid) throw new InvalidOperationException("Port configurations do not match");
     145      return await ServicePort.ProcessAsync(parameters, token);
    132146    }
    133147
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj

    r11465 r11468  
    1010    <RootNamespace>HeuristicLab.Optimization.Networks</RootNamespace>
    1111    <AssemblyName>HeuristicLab.Optimization.Networks-3.3</AssemblyName>
    12     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     12    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1313    <FileAlignment>512</FileAlignment>
    1414    <TargetFrameworkProfile />
     
    2222    <ErrorReport>prompt</ErrorReport>
    2323    <WarningLevel>4</WarningLevel>
     24    <Prefer32Bit>false</Prefer32Bit>
    2425  </PropertyGroup>
    2526  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    3031    <ErrorReport>prompt</ErrorReport>
    3132    <WarningLevel>4</WarningLevel>
     33    <Prefer32Bit>false</Prefer32Bit>
    3234  </PropertyGroup>
    3335  <PropertyGroup>
     
    4547    <ErrorReport>prompt</ErrorReport>
    4648    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     49    <Prefer32Bit>false</Prefer32Bit>
    4750  </PropertyGroup>
    4851  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     
    5457    <ErrorReport>prompt</ErrorReport>
    5558    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     59    <Prefer32Bit>false</Prefer32Bit>
    5660  </PropertyGroup>
    5761  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     
    6367    <ErrorReport>prompt</ErrorReport>
    6468    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     69    <Prefer32Bit>false</Prefer32Bit>
    6570  </PropertyGroup>
    6671  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     
    7277    <ErrorReport>prompt</ErrorReport>
    7378    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     79    <Prefer32Bit>false</Prefer32Bit>
    7480  </PropertyGroup>
    7581  <ItemGroup>
     
    129135  </ItemGroup>
    130136  <ItemGroup>
     137    <None Include="ClassDiagram.cd" />
    131138    <None Include="HeuristicLab.snk" />
    132139    <None Include="Plugin.cs.frame" />
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IClientNode.cs

    r11465 r11468  
    2222using HeuristicLab.Core;
    2323using System;
     24using System.Threading;
     25using System.Threading.Tasks;
    2426
    2527namespace HeuristicLab.Optimization.Networks {
     
    2830    IItemCollection<ServiceParameterCollection> Calls { get; }
    2931
    30     void CallAsync();
     32    Task CallServicesAsync();
     33    Task CallServicesAsync(CancellationToken token);
    3134  }
    3235}
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IClientPort.cs

    r11454 r11468  
    2121
    2222using System;
     23using System.Threading;
     24using System.Threading.Tasks;
    2325
    2426namespace HeuristicLab.Optimization.Networks {
     
    3133    bool IsValidServicePort(IServicePort servicePort);
    3234    ServiceParameterCollection PrepareParameters();
    33     ServiceParameterCollection Call(ServiceParameterCollection parameters);
     35    ServiceParameterCollection CallService(ServiceParameterCollection parameters);
     36    ServiceParameterCollection CallService(ServiceParameterCollection parameters, CancellationToken token);
     37    Task<ServiceParameterCollection> CallServiceAsync(ServiceParameterCollection parameters);
     38    Task<ServiceParameterCollection> CallServiceAsync(ServiceParameterCollection parameters, CancellationToken token);
    3439  }
    3540}
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IServicePort.cs

    r11454 r11468  
    2323using HeuristicLab.Core;
    2424using System;
     25using System.Threading;
     26using System.Threading.Tasks;
    2527
    2628namespace HeuristicLab.Optimization.Networks {
    2729  public interface IServicePort : IClientServicePort {
    28     ServiceParameterCollection Call(ServiceParameterCollection parameters);
    29     event EventHandler<EventArgs<ServiceParameterCollection>> Called;
     30    ServiceParameterCollection Process(ServiceParameterCollection parameters);
     31    ServiceParameterCollection Process(ServiceParameterCollection parameters, CancellationToken token);
     32    Task<ServiceParameterCollection> ProcessAsync(ServiceParameterCollection parameters);
     33    Task<ServiceParameterCollection> ProcessAsync(ServiceParameterCollection parameters, CancellationToken token);
     34    event EventHandler<EventArgs<ServiceParameterCollection, CancellationToken>> ProcessParameters;
    3035  }
    3136}
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/ServicePort.cs

    r11454 r11468  
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2525using System;
     26using System.Threading;
     27using System.Threading.Tasks;
    2628
    2729namespace HeuristicLab.Optimization.Networks {
     
    4042    }
    4143
    42     public ServiceParameterCollection Call(ServiceParameterCollection parameters) {
    43       return OnCalled(parameters);
     44    public ServiceParameterCollection Process(ServiceParameterCollection parameters) {
     45      return Process(parameters, new CancellationToken());
     46    }
     47    public ServiceParameterCollection Process(ServiceParameterCollection parameters, CancellationToken token) {
     48      return OnProcessParameters(parameters, token);
     49    }
     50    public async Task<ServiceParameterCollection> ProcessAsync(ServiceParameterCollection parameters) {
     51      return await ProcessAsync(parameters, new CancellationToken());
     52    }
     53    public async Task<ServiceParameterCollection> ProcessAsync(ServiceParameterCollection parameters, CancellationToken token) {
     54      return await Task.Run(() => { return Process(parameters, token); }, token);
    4455    }
    4556
    46     public event EventHandler<EventArgs<ServiceParameterCollection>> Called;
    47     protected virtual ServiceParameterCollection OnCalled(ServiceParameterCollection parameters) {
    48       var handler = Called;
    49       if (handler != null) handler(this, new EventArgs<ServiceParameterCollection>(parameters));
     57    public event EventHandler<EventArgs<ServiceParameterCollection, CancellationToken>> ProcessParameters;
     58    protected virtual ServiceParameterCollection OnProcessParameters(ServiceParameterCollection parameters, CancellationToken token) {
     59      var handler = ProcessParameters;
     60      if (handler != null) handler(this, new EventArgs<ServiceParameterCollection, CancellationToken>(parameters, token));
    5061      return parameters;
    5162    }
Note: See TracChangeset for help on using the changeset viewer.