blob: 902f6d6e990ffcaf96937b1d97d7b1bfec6d83c5 [file] [log] [blame]
atraczyk8ce1dee2016-08-25 18:15:07 -04001/***************************************************************************
2 * Copyright (C) 2016 by Savoir-faire Linux *
3 * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
4 * Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 **************************************************************************/
19
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040020#include "pch.h"
21
22#include "Account.h"
23
24using namespace Windows::ApplicationModel::Core;
25using namespace Platform;
26using namespace Windows::UI::Core;
27
28using namespace RingClientUWP;
29
30Account::Account(String^ name,
atraczyk8ce1dee2016-08-25 18:15:07 -040031 String^ ringID,
atraczyk797fa1a2016-08-31 09:55:53 -040032 String^ accountType,
Nicolas Jager813cf4d2016-10-06 10:54:46 -040033 String^ accountID,
Nicolas Jager6abfc0d2016-10-21 14:57:47 -040034 String^ deviceId,
Nicolas Jager0a7b77d2016-10-26 12:26:43 -040035 bool upnpState,
36 String^ sipHostname,
37 String^ sipUsername,
38 String^ sipPassword)
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040039{
40 name_ = name;
41 ringID_ = ringID;
atraczyk8ce1dee2016-08-25 18:15:07 -040042 accountType_ = accountType;
atraczyk797fa1a2016-08-31 09:55:53 -040043 accountID_ = accountID;
Nicolas Jager813cf4d2016-10-06 10:54:46 -040044 _deviceId = deviceId;
Nicolas Jager6abfc0d2016-10-21 14:57:47 -040045 _upnpState = _upnpState;
Nicolas Jager0a7b77d2016-10-26 12:26:43 -040046 _sipHostname = sipHostname;
47 _sipUsername = sipUsername;
48 _sipPassword = sipPassword;
49
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040050}
51
52void
53Account::NotifyPropertyChanged(String^ propertyName)
54{
55 CoreApplicationView^ view = CoreApplication::MainView;
56 view->CoreWindow->Dispatcher->RunAsync(
Nicolas Jager9edbea32016-10-03 09:13:53 -040057 CoreDispatcherPriority::High,
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040058 ref new DispatchedHandler([this, propertyName]()
59 {
60 PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
Nicolas Jagerbff5fbb2016-08-18 08:58:56 -040061 }));
62}