Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.73 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.Composition;
  4. using System.Linq;
  5. using System.Threading;
  6. using Castel.SharedClientLibrary.Model;
  7.  
  8. namespace Castel.SharedClientLibrary.Services.Stubs
  9. {
  10.     [PartCreationPolicy(CreationPolicy.Shared)]
  11. #if USE_STUBS
  12.     [Export(typeof (IAdministrationService))]
  13. #endif
  14.     public class AdministrationServiceStub : IAdministrationService
  15.     {
  16.         public IList<IApplicationUser> GetAllApplicationUsers()
  17.         {
  18.             //Thread.Sleep(2500);
  19.             return new List<IApplicationUser>
  20.                        {
  21.                            new ApplicationUser
  22.                                {FriendlyName = "Giorgio G.", Password = "12345", Username = "giorgiog", UserId = 1},
  23.                            new ApplicationUser
  24.                                {FriendlyName = "Dave C.", Password = "12345", Username = "davec", UserId = 2},
  25.                            new ApplicationUser
  26.                                {FriendlyName = "Rachid C.", Password = "12345", Username = "rachidc", UserId = 3},
  27.                            new ApplicationUser
  28.                                {FriendlyName = "John R.", Password = "12345", Username = "johnr", UserId = 4},
  29.                            new ApplicationUser
  30.                                {FriendlyName = "Andy K.", Password = "12345", Username = "andyk", UserId = 5},
  31.                        };
  32.         }
  33.  
  34.         public IApplicationUser GetUser(int userId)
  35.         {
  36.             return GetAllApplicationUsers().Where(x => x.UserId == userId).FirstOrDefault();
  37.         }
  38.  
  39.         public IApplicationSettings GetApplicationSettings(int profileId)
  40.         {
  41.             IApplicationSettings appSettings = new ApplicationSettings();
  42.             appSettings.OwnerId = 12345;
  43.             appSettings.ProfileName = "Profile One";
  44.             appSettings.Settings = new List<IUniversalSettings>
  45.                                        {
  46.                                            new UniversalSettings
  47.                                                {
  48.                                                    Count = 2,
  49.                                                    Emotion = "Anger",
  50.                                                    Enable = "Y",
  51.                                                    Logic = "OR",
  52.                                                    Normal = "3",
  53.                                                    Range = "0-50",
  54.                                                    Segments = 20,
  55.                                                    Threshold = "NA",
  56.                                                    YellowHigh = "4",
  57.                                                    YellowLow = "1"
  58.                                                },
  59.                                            new UniversalSettings
  60.                                                {
  61.                                                    Count = 3,
  62.                                                    Emotion = "Upset",
  63.                                                    Enable = "Y",
  64.                                                    Logic = "OR",
  65.                                                    Normal = "3",
  66.                                                    Range = "0-50",
  67.                                                    Segments = 20,
  68.                                                    Threshold = "NA",
  69.                                                    YellowHigh = "4",
  70.                                                    YellowLow = "1"
  71.                                                },
  72.                                            new UniversalSettings
  73.                                                {
  74.                                                    Count = 4,
  75.                                                    Emotion = "Voice Energy",
  76.                                                    Enable = "Y",
  77.                                                    Logic = "OR",
  78.                                                    Normal = "3",
  79.                                                    Range = "0-50",
  80.                                                    Segments = 20,
  81.                                                    Threshold = "NA",
  82.                                                    YellowHigh = "4",
  83.                                                    YellowLow = "1"
  84.                                                },
  85.                                            new UniversalSettings
  86.                                                {
  87.                                                    Count = 5,
  88.                                                    Emotion = "Excitement",
  89.                                                    Enable = "N",
  90.                                                    Logic = "OR",
  91.                                                    Normal = "3",
  92.                                                    Range = "0-50",
  93.                                                    Segments = 20,
  94.                                                    Threshold = "NA",
  95.                                                    YellowHigh = "4",
  96.                                                    YellowLow = "1"
  97.                                                  
  98.                                                },
  99.  
  100.                                        };
  101.            
  102.  
  103.        
  104.            
  105.             return appSettings;
  106.         }
  107.  
  108.         //public IApplicationSettings GetApplicationSettings(string profileName)
  109.         //{
  110.         //    //return new ApplicationSettings(){ProfileName = "Base Profile", BorderFileName = "border.file", Count = 4, Emotion = };
  111.         //    return new ApplicationSettings();
  112.         //}
  113.     }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement