private void btnStar_Click(object sender, EventArgs e) { if (_displayScreenName != null && this.Tag is DesktopImage) { DesktopImage imageData = (DesktopImage)this.Tag; if (sender == star1 && imageData.StarRating != 1) { imageData.StarRating = 1; } else if (sender == star2 && imageData.StarRating != 2) { imageData.StarRating = 2; } else if (sender == star3 && imageData.StarRating != 3) { imageData.StarRating = 3; } else if (sender == star4 && imageData.StarRating != 4) { imageData.StarRating = 4; } else if (sender == star5 && imageData.StarRating != 5) { imageData.StarRating = 5; } else { imageData.StarRating = 0; } } }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Id == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } if (DesktopImage != null) { DesktopImage.Validate(); } if (MobileImage != null) { MobileImage.Validate(); } if (Features != null) { foreach (var element in Features) { if (element != null) { element.Validate(); } } } }
private void btnOpenExplorerOnLogonImageLocation_Click(object sender, EventArgs e) { string imageBaseFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); string imageFolder = imageBaseFolder + @"\PhotoDesktop"; string fullfilename = imageBaseFolder + @"\PhotoDesktop" + @"\PhotoDesktopLogongImage.png"; // check if folder exists bool exists = System.IO.Directory.Exists(imageFolder); if (!exists) { System.IO.Directory.CreateDirectory(imageFolder); } // create folder Screen[] screens = Screen.AllScreens; Screen screen = screens[0]; DesktopImage logonImage = new DesktopImage(_photoDesktop.ImageList.Next(screen.DeviceName)); Wallpaper.CreateLogonScreenImage(logonImage, fullfilename); StartProcess(imageFolder); // https://winaero.com/blog/file-explorer-command-line-arguments-in-windows-10/ // explorer.exe /select,"C:\apps\firefox beta\firefox.exe" // explorer.exe /e,folder_path }
internal DisplayConfigDesktopImageInfo?GetDisplayConfigDesktopImageInfo() { if (IsDesktopImageInformationAvailable) { return(DesktopImage.GetDisplayConfigDesktopImageInfo()); } return(null); }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="Microsoft.Rest.ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (DesktopImage != null) { DesktopImage.Validate(); } if (MobileImage != null) { MobileImage.Validate(); } }
public override void Refresh() { if (_displayScreenName != null && this.Tag is DesktopImage) { DesktopImage imageData = (DesktopImage)this.Tag; if (imageData.StarRating > 0) { star1.ImageIndex = 1; } else { star1.ImageIndex = 0; } if (imageData.StarRating > 1) { star2.ImageIndex = 1; } else { star2.ImageIndex = 0; } if (imageData.StarRating > 2) { star3.ImageIndex = 1; } else { star3.ImageIndex = 0; } if (imageData.StarRating > 3) { star4.ImageIndex = 1; } else { star4.ImageIndex = 0; } if (imageData.StarRating > 4) { star5.ImageIndex = 1; } else { star5.ImageIndex = 0; } } base.Refresh(); }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } if (Specialities == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Specialities"); } if (Education == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Education"); } if (DesktopImage != null) { DesktopImage.Validate(); } if (MobileImage != null) { MobileImage.Validate(); } }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Id == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } if (Name == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } if (Address == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Address"); } if (Contact == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Contact"); } if (Location == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Location"); } if (StaffedHours == null) { throw new ValidationException(ValidationRules.CannotBeNull, "StaffedHours"); } if (Features == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Features"); } if (PersonalTrainers == null) { throw new ValidationException(ValidationRules.CannotBeNull, "PersonalTrainers"); } if (GroupTraining == null) { throw new ValidationException(ValidationRules.CannotBeNull, "GroupTraining"); } if (DesktopImage != null) { DesktopImage.Validate(); } if (MobileImage != null) { MobileImage.Validate(); } if (Address != null) { Address.Validate(); } if (Location != null) { Location.Validate(); } if (StaffedHours != null) { foreach (var element in StaffedHours) { if (element != null) { element.Validate(); } } } if (Features != null) { foreach (var element1 in Features) { if (element1 != null) { element1.Validate(); } } } if (PersonalTrainers != null) { foreach (var element2 in PersonalTrainers) { if (element2 != null) { element2.Validate(); } } } if (SosChildrensVillage != null) { SosChildrensVillage.Validate(); } if (GroupTraining != null) { foreach (var element3 in GroupTraining) { if (element3 != null) { element3.Validate(); } } } }
/* * private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs) * { * _keyEventControl.PreviewKeyDown -= DesktopImageOnPreviewKeyDown; * _keyEventControl.PreviewKeyUp -= DesktopImageOnPreviewKeyUp; * } * * private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) * { * _keyEventControl = ((RemoteDesktopViewModel) DataContext).WindowService.IsExternalWindow * ? (Control) this * : Application.Current.MainWindow; * * _keyEventControl.PreviewKeyDown += DesktopImageOnPreviewKeyDown; * _keyEventControl.PreviewKeyUp += DesktopImageOnPreviewKeyUp; * } */ private void DesktopImageOnMouseDown(object sender, MouseButtonEventArgs e) { DesktopImage.Focus(); ((RemoteDesktopViewModel)DataContext).DesktopImageOnMouseDown(e, DesktopImage.RenderSize, e.GetPosition(DesktopImage)); }