예제 #1
0
 public RecentsViewModel(INavigationService navService, UDCListModel udc)
 {
     this.navService = navService;
     this.udc = udc;
     this.DisplayName = "Recents";
     CreateApplicationBarButtons();
 }
예제 #2
0
        public void TestUDCListModel()
        {
            UDCListModel udc = new UDCListModel("Data Source=isostore:/Test1.sdf", true);
            UserModel testUser = new UserModel("1", "foo", "bar", "");
            udc.addUser(testUser);

            Assert.Equals(testUser, udc.UsersByFirstName[0]);
            Assert.IsTrue(udc.SubmitChanges());

            udc.LoadListsFromDatabase();

            Assert.Equals(testUser, udc.UsersByFirstName[0]);

            GroupModel testGroup = new GroupModel("TestGroup");
            udc.addGroup(testGroup);
            udc.addToGroup(testUser, testGroup);

            Assert.IsTrue(udc.GroupList[0].Users.Contains(testUser));

            CallLogEntry testEntry = new CallLogEntry();
            CallLogModel testLog = new CallLogModel(1);
            testLog.addEntry(testEntry);
            testUser.CallLogs.Add(testLog);

            Assert.IsTrue(udc.SubmitChanges());
            Assert.IsTrue(testUser.CallLogs.Any());
            Assert.Equals(testUser.CallLogs.First(), testLog);

            udc.removeGroup("TestGroup");
            Assert.IsTrue(udc.GroupList.Count == 0);
        }
예제 #3
0
        public Connection(INavigationService navService, SettingsModel setModel, UDCListModel udc, IPhoneService phoneService)
        {
            phoneService.Deactivated += new EventHandler<Microsoft.Phone.Shell.DeactivatedEventArgs>(phoneService_Deactivated);
            phoneService.Activated += new EventHandler<Microsoft.Phone.Shell.ActivatedEventArgs>(phoneService_Activated);
            Crypt.init();
            this.LastSendOperation = -1;
            this.LastReceiveOperation = -1;
            this.navService = navService;
            this.setModel = setModel;
            this.udc = udc;
            this.VoicePort = null;

            this.keepaliveWorker = new DispatcherTimer();
            keepaliveWorker.Interval = TimeSpan.FromSeconds(20);
            keepaliveWorker.Tick += new EventHandler(keepaliveWorker_Tick);

            Analyzing = false;
            this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            //this.sendArgs = new SocketAsyncEventArgs();
            //this.receiveArgs = new SocketAsyncEventArgs();
            //sendArgs.UserToken = true; // UserToken zeigt an, ob das Objekt gerade verfügbar ist.
            //receiveArgs.UserToken = true;
            //sendArgs.Completed += new EventHandler<SocketAsyncEventArgs>(Send_Completed);
            //receiveArgs.Completed += new EventHandler<SocketAsyncEventArgs>(Receive_Completed);

            Connect();
        }
예제 #4
0
        public ContactsViewModel(INavigationService navService, SettingsModel sm, UDCListModel udc)
        {
            this.navService = navService;
            this.DisplayName = "contacts";
            CreateApplicationBarButtons();

            this.sm = sm;
            NotifyOfPropertyChange("NameOrder");
            this.udc = udc;
            NotifyOfPropertyChange("UsersByName");
        }
예제 #5
0
 public EchoClientLogic(INavigationService navService, IWindowManager winMan, UDCListModel udc)
 {
     myWorker = new BackgroundWorker();
     this.navService = navService;
     this.winMan = winMan;
     this.udc = udc;
     this.CalleeID = 0;
     myWorker.WorkerReportsProgress = true;
     myWorker.ProgressChanged += new ProgressChangedEventHandler(myWorker_ProgressChanged);
     myWorker.DoWork += new DoWorkEventHandler(myWorker_DoWork);
 }
예제 #6
0
 public IncomingCallDialogViewModel(UDCListModel udc, IVibrateController vibCon)
 {
     Answered = false;
     this.vibCon = vibCon;
     this.udc = udc;
 }
예제 #7
0
 public CallLogPageViewModel(INavigationService navService, UDCListModel udc)
 {
     this.navService = navService;
     this.udc = udc;
 }
예제 #8
0
 public ContactDetailsPageViewModel(INavigationService navService, UDCListModel udc)
 {
     this.udc = udc;
     this.navService = navService;
 }
예제 #9
0
 public GroupPageViewModel(INavigationService navService, UDCListModel udc, SettingsModel setModel)
 {
     this.navService = navService;
     this.udc = udc;
     this.setModel = setModel;
 }