private void SetSliderPosition(ExplorerViewMode mode) { switch (mode) { case ExplorerViewMode.ExtraLargeIcons: SliderPosition = SliderPositionExtraLarge; break; case ExplorerViewMode.LargeIcons: SliderPosition = SliderPositionLarge; break; case ExplorerViewMode.MediumIcons: SliderPosition = SliderPositionMedium; break; case ExplorerViewMode.SmallIcons: SliderPosition = SliderPositionSmall; break; case ExplorerViewMode.List: SliderPosition = SliderPositionList; break; case ExplorerViewMode.Details: SliderPosition = SliderPositionDetails; break; default: SliderPosition = SliderPositionTiles; break; } }
private void SetScale(ExplorerViewMode mode) { switch (mode) { case ExplorerViewMode.ExtraLargeIcons: Scale = ScaleExtraLarge; break; case ExplorerViewMode.LargeIcons: Scale = ScaleLarge; break; case ExplorerViewMode.MediumIcons: Scale = ScaleMedium; break; case ExplorerViewMode.SmallIcons: Scale = ScaleSmall; break; default: // Do not set scale in other cases, // because those modes do not affect the scale. break; } }
private void SetIcon(ExplorerViewMode mode) { switch (mode) { case ExplorerViewMode.ExtraLargeIcons: Icon = ImageSourceExtraLargeIcons; break; case ExplorerViewMode.LargeIcons: Icon = ImageSourceLargeIcons; break; case ExplorerViewMode.MediumIcons: Icon = ImageSourceMediumIcons; break; case ExplorerViewMode.SmallIcons: Icon = ImageSourceSmallIcons; break; case ExplorerViewMode.List: Icon = ImageSourceList; break; case ExplorerViewMode.Details: Icon = ImageSourceDetails; break; default: Icon = ImageSourceTiles; break; } }
private void SetScale(ExplorerViewMode mode) { switch (mode) { case ExplorerViewMode.ExtraLargeIcons: Scale = ExplorerViewMenu.ScaleExtraLarge; break; case ExplorerViewMode.LargeIcons: Scale = ExplorerViewMenu.ScaleLarge; break; case ExplorerViewMode.MediumIcons: Scale = ExplorerViewMenu.ScaleMedium; break; case ExplorerViewMode.SmallIcons: Scale = ExplorerViewMenu.ScaleSmall; break; default: // Do not change Scale in all other cases, // because the Scale is irrelevant for those modes. break; } }
private void UpdateFromMode(ExplorerViewMode mode) { // Avoid re-entrance. if (_updating) { return; } _updating = true; try { SetScale(mode); SetSliderPosition(mode); SetIcon(mode); } finally { _updating = false; } }
private void UpdateFromMode(ExplorerViewMode mode) { // Avoid re-entrance. if (_updating) return; _updating = true; try { SetScale(mode); SetSliderPosition(mode); SetIcon(mode); } finally { _updating = false; } }