public void Load() { var files = _root.GetLocalFiles().ToList(); var titleFile = files.First(file => file.Name == "title.txt"); Name = File.ReadAllText(titleFile.LocalPath).Trim(); var toolTipFile = files.FirstOrDefault(file => file.Name == "tip.txt"); if (toolTipFile != null) { var tooltipLines = File.ReadAllLines(toolTipFile.LocalPath); ToolTipHeader = tooltipLines.ElementAtOrDefault(0)?.Replace("*", ""); ToolTipBody = tooltipLines.ElementAtOrDefault(1)?.Replace("*", ""); } int tempInt; if (Int32.TryParse(Path.GetFileName(_root.LocalPath), out tempInt)) Order = tempInt; LogoFile = files.FirstOrDefault(file => file.Extension == ".png" && !file.Name.Contains("_rbn")); if (LogoFile != null) { Logo = new Bitmap(LogoFile.LocalPath); BrowseLogo = Logo.GetThumbnailImage((Logo.Width * 144) / Logo.Height, 144, null, IntPtr.Zero); var borderedLogo = Logo.DrawBorder(); RibbonLogo = borderedLogo.GetThumbnailImage((borderedLogo.Width * 72) / borderedLogo.Height, 72, null, IntPtr.Zero); AdBarLogo = borderedLogo.GetThumbnailImage((borderedLogo.Width * 86) / borderedLogo.Height, 86, null, IntPtr.Zero); } _masterFile = files.FirstOrDefault(file => file.Extension == ".pptx"); }
public void Load() { var files = _root.GetLocalFiles().ToList(); var titleFile = files.First(file => file.Name == "title.txt"); Name = File.ReadAllText(titleFile.LocalPath).Trim(); int tempInt; if (Int32.TryParse(Path.GetFileName(_root.LocalPath), out tempInt)) Order = tempInt; var bigLogoFile = files.FirstOrDefault(file => file.Name == "preview.png"); if (bigLogoFile != null) { Logo = new Bitmap(bigLogoFile.LocalPath); BrowseLogo = Logo.GetThumbnailImage(((Logo.Width * 144) / Logo.Height) + 10, 144, null, IntPtr.Zero); var borderedLogo = Logo.DrawBorder(); RibbonLogo = borderedLogo.GetThumbnailImage(((borderedLogo.Width * 72) / borderedLogo.Height) + 10, 72, null, IntPtr.Zero); } _themeFile = files.FirstOrDefault(file => file.Extension == ".thmx"); ApprovedSlides = new List<SlideType>(); }