public EmailWorker(EmailEntry emailEntry, IAPIExtension extension)
 {
     this.emailEntry = emailEntry;
     apiExtension = extension;
     settingsRepository = SimpleIoc.Default.GetInstance<IGenericSettingsRepository<EmailConfig>>();
     apiExtension.MessageSubmitted += apiExtension_MessageSubmitted;
 }
        public LoginViewModel()
        {
            _userSettingsRepository = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IUserInfoSettingsRepository>();
            _settingsRepository     = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AppPreferences> >();

            UserInfo = _userSettingsRepository.GetSettings();
            var settings = _settingsRepository.GetSettings();

            if (UserInfo == null)
            {
                UserInfo = new UserInfo();
                if (settings == null)
                {
                    UserInfo.ServerAddress = string.Format("{0}:{1}", WcfConnectionProperties.Default.Address,
                                                           WcfConnectionProperties.Default.Port);
                }
                else
                {
                    UserInfo.ServerAddress = string.Format("{0}:{1}", settings.ConnectionProperties.Address,
                                                           settings.ConnectionProperties.Port);
                }
            }
            else
            {
                RememberMe = true;
            }

            InitCommands();
            InitView();
        }
Exemplo n.º 3
0
 public EmailWorker(EmailEntry emailEntry, IAPIExtension extension)
 {
     this.emailEntry                = emailEntry;
     apiExtension                   = extension;
     settingsRepository             = SimpleIoc.Default.GetInstance <IGenericSettingsRepository <EmailConfig> >();
     apiExtension.MessageSubmitted += apiExtension_MessageSubmitted;
 }
        public AgentDialerViewModel()
        {
            _client             = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IClient>();
            _settingsRepository = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AppPreferences> >();
            _agentDialer        = (AgentDialer)GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IScheduler <CustomerEntry> >();

            InitAgentDialerCommands();
            InitSettings();
        }
Exemplo n.º 5
0
        public MainViewModel()
        {
            _settingsRepository = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AppPreferences> >();

            InitSettings();
            InitViewModelCommands();
            Logs = new ObservableCollectionEx <string>();

            DatabaseStarter.StartDatabase(_settingsRepository.GetSettings().DatabaseConnectionProperties);
            WcfCrmServer.NotificationReceived += WcfCrmServerOnNotificationReceived;
        }
Exemplo n.º 6
0
 public AgentDialer()
     : base(null)
 {
     _eventLock                = new AutoResetEvent(true);
     _sync                     = new object();
     _client                   = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IClient>();
     _client.SessionCreated   += ClientOnSessionCreated;
     _client.SessionCompleted += ClientOnSessionCompleted;
     _settingsRepository       = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AppPreferences> >();
     _activeSessions           = new ConcurrentDictionary <string, ISession>();
     CurrentConcurrentWorkers  = 0;
     CompletedWorks            = 0;
     _startedCalls             = new ConcurrentList <ICall>();
 }
        public PreferencesViewModel()
        {
            InitCommands();
            _preferences = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance<IGenericSettingsRepository<AppPreferences>>();

            var settings = _preferences.GetSettings();
            if (settings == null)
                return;

            RetryStates = settings.RetryStates;
            Agents = settings.Agents;
            MaxConcurrentCalls = settings.MaxConcurrentCalls;
            ChooseByOccupation = settings.ChooseByOccupation;
            ChooseByStatistics = settings.ChooseByStatistics;
            ApiExtensionId = settings.ExtensionId;
        }
        static SettingsHelper()
        {
            SettingContainer = SimpleIOCContainer.Instance.Resolve<IGenericSettingsRepository<ProgramSettings>>();
            Settings = SettingContainer.GetSettings();
            if (Settings != null) return;

            var appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            var callRecorderPath = Path.Combine(appPath, "Ozeki", "Call recorder");

            Settings = new ProgramSettings
                {
                    RecordableExtensions = new List<string>(),
                    RecordableOutsideLines = new List<string>(),
                    RecordingFileFormat = RecordingFileFormat.MP3,
                    RecordingPath = callRecorderPath
                };
            SettingContainer.SetSettings(Settings);
        }
Exemplo n.º 9
0
        public PreferencesViewModel()
        {
            InitCommands();
            _preferences = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AppPreferences> >();

            var settings = _preferences.GetSettings();

            if (settings == null)
            {
                return;
            }

            RetryStates        = settings.RetryStates;
            Agents             = settings.Agents;
            MaxConcurrentCalls = settings.MaxConcurrentCalls;
            ChooseByOccupation = settings.ChooseByOccupation;
            ChooseByStatistics = settings.ChooseByStatistics;
            ApiExtensionId     = settings.ExtensionId;
        }
Exemplo n.º 10
0
        static SettingsHelper()
        {
            SettingContainer = SimpleIOCContainer.Instance.Resolve <IGenericSettingsRepository <ProgramSettings> >();
            Settings         = SettingContainer.GetSettings();
            if (Settings != null)
            {
                return;
            }

            var appPath          = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            var callRecorderPath = Path.Combine(appPath, "Ozeki", "Call recorder");

            Settings = new ProgramSettings
            {
                RecordableExtensions   = new List <string>(),
                RecordableOutsideLines = new List <string>(),
                RecordingFileFormat    = RecordingFileFormat.MP3,
                RecordingPath          = callRecorderPath
            };
            SettingContainer.SetSettings(Settings);
        }
        public MainViewModel()
        {
            _settingsRepository = SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AppPreferences> >();
            _lockObj            = new object();

            _wcfCrmClient = SimpleIoc.Default.GetInstance <WcfCrmClient>();
            _wcfCrmClient.CrmServerCallHistoryEntryAdded += WcfCrmClientOnCrmServerCallHistoryEntryAdded;
            _wcfCrmClient.CrmServerCallReceived          += WcfCrmClientOnCrmServerCallReceived;
            _wcfCrmClient.CrmServerEntryAdded            += WcfCrmClientOnCrmServerEntryAdded;
            _wcfCrmClient.CrmServerEntryDeleted          += WcfCrmClientOnCrmServerEntryDeleted;
            _wcfCrmClient.CrmServerEntryModified         += WcfCrmClientOnCrmServerEntryModified;

            _internalCrmEntries = new ObservableCollectionEx <CrmEntry>();
            CrmEntries          = CollectionViewSource.GetDefaultView(_internalCrmEntries);
            NewCrmEntryNote     = new CrmNote();

            InitMessenger();
            InitSettings();
            InitViewCommands();

            _wcfCrmClient.Connect();
            RebuildCrmEntries();
        }
        public LoginViewModel()
        {
            _userSettingsRepository = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance<IUserInfoSettingsRepository>();
            _settingsRepository = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance<IGenericSettingsRepository<AppPreferences>>();

            UserInfo = _userSettingsRepository.GetSettings();
            var settings = _settingsRepository.GetSettings();

            if (UserInfo == null)
            {
                UserInfo = new UserInfo();
                if (settings == null)
                    UserInfo.ServerAddress = string.Format("{0}:{1}", WcfConnectionProperties.Default.Address,
                                                           WcfConnectionProperties.Default.Port);
                else
                    UserInfo.ServerAddress = string.Format("{0}:{1}", settings.ConnectionProperties.Address,
                                                           settings.ConnectionProperties.Port);
            }
            else
                RememberMe = true;

            InitCommands();
            InitView();
        }
Exemplo n.º 13
0
 public AutoDialerViewModel()
 {
     settingsRepository = SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AutoDialerConfig> >();
 }
Exemplo n.º 14
0
 public SettingsViewModel()
 {
     InitCommands();
     settingsRepository = SimpleIoc.Default.GetInstance <IGenericSettingsRepository <AutoDialerConfig> >();
     GetSettings();
 }
Exemplo n.º 15
0
 public SettingsViewModel()
 {
     InitCommands();
     settingsRepository = SimpleIoc.Default.GetInstance<IGenericSettingsRepository<AutoDialerConfig>>();
     GetSettings();
 }
Exemplo n.º 16
0
 public EmailViewModel()
 {
     settingsRepository = SimpleIoc.Default.GetInstance <IGenericSettingsRepository <EmailConfig> >();
 }