public static SlideSettings ReadFromString(string size)
        {
            var slideSettings = new SlideSettings();

            switch (size)
            {
            case "4x3":
                slideSettings.SlideSize.Width  = 10;
                slideSettings.SlideSize.Height = 7.5m;
                break;

            case "3x4":
                slideSettings.SlideSize.Width  = 7.5m;
                slideSettings.SlideSize.Height = 10;
                break;

            case "16x9":
                slideSettings.SlideSize.Width  = 13.333m;
                slideSettings.SlideSize.Height = 7.5m;
                break;

            default:
                throw new ArgumentOutOfRangeException("Can't parse slide configuration");
            }
            return(slideSettings);
        }
		public void ApplySettings(SlideSettings newSettings)
		{
			var args = new SlideSettingsChangingEventArgs();
			SettingsChanging?.Invoke(this, args);
			if (args.Cancel) return;
			SlideSettings = newSettings;
			_powerPointHelper.SetSlideSettings(SlideSettings);
			SettingsChanged?.Invoke(this, EventArgs.Empty);
		}
		public static SlideSettings ReadFromString(string size)
		{
			var slideSettings = new SlideSettings();
			switch (size)
			{
				case "4x3":
					slideSettings.SlideSize.Width = 10;
					slideSettings.SlideSize.Height = 7.5m;
					break;
				case "3x4":
					slideSettings.SlideSize.Width = 7.5m;
					slideSettings.SlideSize.Height = 10;
					break;
				case "16x9":
					slideSettings.SlideSize.Width = 13.333m;
					slideSettings.SlideSize.Height = 7.5m;
					break;
				default:
					throw new ArgumentOutOfRangeException("Can't parse slide configuration");
			}
			return slideSettings;
		}
 public bool IsEqual(SlideSettings target)
 {
     return(target.Format == Format);
 }
		private PowerPointManager()
		{
			SlideSettings = new SlideSettings();
		}
		private void GetActiveSettings()
		{
			SlideSettings = _powerPointHelper.GetSlideSettings() ?? SlideSettings;
		}
		private void GetDefaultSettings()
		{
			if (!ResourceManager.Instance.DefaultSlideSettingsFile.ExistsLocal()) return;
			var document = new XmlDocument();
			document.Load(ResourceManager.Instance.DefaultSlideSettingsFile.LocalPath);
			var node = document.SelectSingleNode(@"/Settings/Size");
			if (node != null)
				SlideSettings = SlideSettings.ReadFromString(node.InnerText.Trim());
		}
Beispiel #8
0
 public bool HasSlideConfiguration(SlideSettings slideSettings)
 {
     return(new StorageDirectory(_sourceFolder.RelativePathParts.Merge(slideSettings.SlideFolder)).ExistsLocal());
 }
		public bool HasSlideConfiguration(SlideSettings slideSettings)
		{
			return new StorageDirectory(_sourceFolder.RelativePathParts.Merge(slideSettings.SlideFolder)).ExistsLocal();
		}
		public bool IsEqual(SlideSettings target)
		{
			return target.Format == Format;
		}