private void LockButton_Click(object sender, RoutedEventArgs e) { if ((bool)LockButton.IsChecked) { ServerService.instance.Socket.Emit("imageProtectionLevelChanged", CurrentGalleryCard.Image.id); CurrentGalleryCard.Image.protectionLevel = "private"; } else if (CurrentGalleryCard.Image.password == null || CurrentGalleryCard.Image.password == "") { CurrentGalleryCard.Image.protectionLevel = "public"; } else { CurrentGalleryCard.Image.protectionLevel = "protected"; } CurrentGalleryCard.ConfigIcon(); ImageDao.Put(CurrentGalleryCard.Image); ConfigImageViewButtons(); }
private void EditImageInformationsButton_Click(object sender, RoutedEventArgs e) { CurrentGalleryCard.ImageTitle.Text = CurrentImageTitle.Text; ImageViewTitle.Text = CurrentImageTitle.Text; if (CurrentGalleryCard.Image.protectionLevel != "private") { if (CurrentImagePassword.Text == "") { CurrentGalleryCard.Image.password = null; CurrentGalleryCard.Image.protectionLevel = "public"; } else { ServerService.instance.Socket.Emit("imageProtectionLevelChanged", CurrentGalleryCard.Image.id); CurrentGalleryCard.Image.password = CurrentImagePassword.Text; CurrentGalleryCard.Image.protectionLevel = "protected"; } CurrentGalleryCard.ConfigIcon(); } ImageDao.Put(CurrentGalleryCard.Image); }