protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { MDEDB = new MDEDataContext(); int meetingID = int.Parse(NavigationContext.QueryString["meetingID"]); meeting = new ObservableCollection<Meeting>(from Meeting m in MDEDB.Meetings where m.ID == meetingID select m)[0]; base.OnNavigatedTo(e); }
//private List<File> files; protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { MDEDB = new MDEDataContext(); int meetingID = int.Parse(NavigationContext.QueryString["meetingID"]); meeting = new ObservableCollection<Meeting>(from Meeting m in MDEDB.Meetings where m.ID == meetingID select m)[0]; //server = meeting.server; //files = meeting.files.ToList(); serverNameBlock.Text = meeting.server.serverName; meetingNameBlock.Text = meeting.title; imgQRCode.Source = GenerateQRCode("mde;"+meeting.server.address+";"+meeting.serverMeetingID+";"+meeting.code); base.OnNavigatedTo(e); }
//Code for initialization, capture completed, image availability events; also setting the source for the viewfinder. protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { MDEDB = new MDEDataContext(); int meetingID = int.Parse(NavigationContext.QueryString["meetingID"]); meeting = new ObservableCollection<Meeting>(from Meeting m in MDEDB.Meetings where m.ID == meetingID select m)[0]; // Check to see if the camera is available on the phone. if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true) || (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing) == true)) { // Initialize the camera, when available. if (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing)) { // Use front-facing camera if available. cam = new Microsoft.Devices.PhotoCamera(CameraType.FrontFacing); } else { // Otherwise, use standard camera on back of phone. cam = new Microsoft.Devices.PhotoCamera(CameraType.Primary); } // Event is fired when the PhotoCamera object has been initialized. cam.Initialized += new EventHandler<Microsoft.Devices.CameraOperationCompletedEventArgs>(cam_Initialized); // Event is fired when the capture sequence is complete and an image is available. cam.CaptureImageAvailable += new EventHandler<Microsoft.Devices.ContentReadyEventArgs>(cam_CaptureImageAvailable); //Set the VideoBrush source to the camera. viewfinderBrush.SetSource(cam); } else { // The camera is not supported on the phone. this.Dispatcher.BeginInvoke(delegate() { // Write message. txtDebug.Text = "A Camera is not available on this phone."; // Disable UI. ShutterButton.IsEnabled = false; }); } }
public Meeting getEntity(Server server) { Meeting meeting = new Meeting(); meeting.server = server; meeting.serverMeetingID = meetingid; meeting.title = title; meeting.topic = topic; meeting.adminName = hostname; meeting.startTime = starttime; meeting.endTime = endtime; meeting.numerOfMembers = members; meeting.permissions = permissions == "memberUpload" ? 1 : (permissions == "member" ? 0 : 2); meeting.code = accessCode; return meeting; }
public File getEntity(Meeting meeting) { File file = new File(); file.meeting = meeting; file.serverFileID = fileid; file.fileName = filename; file.authorName = author; file.hash = hash; List<Comment> list = new List<Comment>(); foreach(CommentOutput comment in comments) list.Add(comment.getEntity(file) ); file.comments.AddRange(list); return file; }
private void createMeetingCallback(MeetingOutput output) { this.Dispatcher.BeginInvoke(delegate() { if (output.status == "ok") { Meeting meeting = new Meeting(); meeting.server = server; meeting.serverMeetingID = Convert.ToInt32(output.meetingid); meeting.title = output.title; meeting.topic = output.topic; meeting.adminName = output.hostname; meeting.startTime = output.starttime; meeting.numerOfMembers = 1; meeting.permissions = 2; meeting.code = output.accessCode; MDEDB.Meetings.InsertOnSubmit(meeting); MDEDB.SubmitChanges(); MessageBox.Show("Meeting created"); NavigationService.RemoveBackEntry(); NavigationService.Navigate(new Uri("/Pages/MeetingPage.xaml?meetingID=" + meeting.ID + "&removePrevious=" + bool.TrueString, UriKind.Relative)); } else { MessageBox.Show("Unable to join meeting.\nServer response:\n" + output.reason); setControlEnabled(true); } }); }
// Called during a remove operation private void detach_meeting(Meeting meeting) { NotifyPropertyChanging("ToDoItem"); meeting.server = null; }
// Called during an add operation private void attach_meeting(Meeting meeting) { NotifyPropertyChanging("ToDoItem"); meeting.server = this; }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { #region Actualising navigation stack bool remove = false; if (NavigationContext.QueryString.ContainsKey("removePrevious")) { remove = ((string)NavigationContext.QueryString["removePrevious"]).Equals(bool.TrueString); NavigationContext.QueryString.Remove("removePrevious"); } if (remove) { NavigationService.RemoveBackEntry(); } #endregion MDEDB = new MDEDataContext(); int meetingID = int.Parse( NavigationContext.QueryString["meetingID"] ); meeting = new ObservableCollection<Meeting>(from Meeting m in MDEDB.Meetings where m.ID == meetingID select m)[0]; server = meeting.server; files = new ObservableCollection<File>(meeting.files); PivotRoot.Title = server.serverName; #region Details titleBlock.Text = meeting.title; topicBlock.Text = meeting.topic; organisatorBlock.Text = meeting.adminName; if (meeting.endTime == null) { timeBlock.Text = meeting.startTime; stateBlock.Text = "Trwa (liczba użytkowników: " + meeting.numerOfMembers + " )"; } else { timeBlock.Text = meeting.startTime + " - " + meeting.endTime; stateBlock.Text = "Zakończone (l. użytkowników: " + meeting.numerOfMembers + " )"; } //permision = 0 - member //1 - member upload //2 - admin if (meeting.permissions == 2) { permissionBlock.Text = "Admin"; settingsButton.Visibility = System.Windows.Visibility.Visible; } else { settingsButton.Visibility = System.Windows.Visibility.Collapsed; if(meeting.permissions == 1) permissionBlock.Text = "Member with upload permission"; else permissionBlock.Text = "Member without upload permission"; } #endregion refresh(); _timer.Start(); base.OnNavigatedTo(e); }