Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/16 22:31:28 (8 years ago)
Author:
abeham
Message:

#2588:

  • Returning id in add solution method
  • Added method to delete solutions
  • Added client methods in RunCreationClient that match the service methods
  • Made all service methods non-static in RunCreationClient
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.OKB/3.3/RunCreation/RunCreationClient.cs

    r13550 r13684  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.IO;
    25 using System.Linq;
    2622using HeuristicLab.Clients.Common;
    2723using HeuristicLab.Common;
     
    2925using HeuristicLab.Data;
    3026using HeuristicLab.Persistence.Default.Xml;
     27using System;
     28using System.Collections.Generic;
     29using System.IO;
     30using System.Linq;
    3131
    3232namespace HeuristicLab.Clients.OKB.RunCreation {
     
    8686
    8787    #region Algorithm Methods
    88     public static byte[] GetAlgorithmData(long algorithmId) {
     88    public byte[] GetAlgorithmData(long algorithmId) {
    8989      return CallRunCreationService<byte[]>(s => s.GetAlgorithmData(algorithmId));
    9090    }
     
    9292
    9393    #region Problem Methods
    94     public static byte[] GetProblemData(long problemId) {
     94    public byte[] GetProblemData(long problemId) {
    9595      return CallRunCreationService<byte[]>(s => s.GetProblemData(problemId));
     96    }
     97    #endregion
     98
     99    #region Solution Methods
     100    public IEnumerable<Solution> GetSolutions(long problemId) {
     101      return CallRunCreationService(s => s.GetSolutions(problemId));
     102    }
     103
     104    public byte[] GetSolutionData(long solutionId) {
     105      return CallRunCreationService(s => s.GetSolutionData(solutionId));
     106    }
     107
     108    public long AddSolution(Solution solution, byte[] data) {
     109      return CallRunCreationService(s => s.AddSolution(solution, data));
     110    }
     111
     112    public void DeleteSolution(Solution solution) {
     113      CallRunCreationService(s => s.DeleteSolution(solution));
    96114    }
    97115    #endregion
     
    104122
    105123    #region Characteristic Methods
    106     public static IEnumerable<Value> GetCharacteristicValues(long problemId) {
     124    public IEnumerable<Value> GetCharacteristicValues(long problemId) {
    107125      return CallRunCreationService(s => s.GetCharacteristicValues(problemId));
    108126    }
    109127
    110     public static void SetCharacteristicValue(long problemId, Value v) {
     128    public void SetCharacteristicValue(long problemId, Value v) {
    111129      CallRunCreationService(s => s.SetCharacteristicValue(problemId, v));
    112130    }
    113131
    114     public static void SetCharacteristicValues(long problemId, IEnumerable<Value> values) {
     132    public void SetCharacteristicValues(long problemId, IEnumerable<Value> values) {
    115133      CallRunCreationService(s => s.SetCharacteristicValues(problemId, values.ToList()));
    116134    }
     
    208226
    209227    #region Helpers
    210     private static void CallRunCreationService(Action<IRunCreationService> call) {
     228    private void CallRunCreationService(Action<IRunCreationService> call) {
    211229      RunCreationServiceClient client = ClientFactory.CreateClient<RunCreationServiceClient, IRunCreationService>();
    212230      try {
     
    220238      }
    221239    }
    222     private static T CallRunCreationService<T>(Func<IRunCreationService, T> call) {
     240    private T CallRunCreationService<T>(Func<IRunCreationService, T> call) {
    223241      RunCreationServiceClient client = ClientFactory.CreateClient<RunCreationServiceClient, IRunCreationService>();
    224242      try {
Note: See TracChangeset for help on using the changeset viewer.