/// <summary>
        /// Returns true if GetDocumentPreviewParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of GetDocumentPreviewParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GetDocumentPreviewParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FileId == input.FileId ||
                     (FileId != null &&
                      FileId.Equals(input.FileId))
                     ) &&
                 (
                     ThumbnailWidth == input.ThumbnailWidth ||
                     ThumbnailWidth.Equals(input.ThumbnailWidth)
                 ) &&
                 (
                     ThumbnailHeight == input.ThumbnailHeight ||
                     ThumbnailHeight.Equals(input.ThumbnailHeight)
                 ) &&
                 (
                     ThumbnailBackgroundColor == input.ThumbnailBackgroundColor ||
                     (ThumbnailBackgroundColor != null &&
                      ThumbnailBackgroundColor.Equals(input.ThumbnailBackgroundColor))
                 ) &&
                 (
                     ThumbnailFitToPageSize == input.ThumbnailFitToPageSize ||
                     ThumbnailFitToPageSize.Equals(input.ThumbnailFitToPageSize)
                 ));
        }
Esempio n. 2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Content != null)
         {
             hashCode = hashCode * 59 + Content.GetHashCode();
         }
         if (FileName != null)
         {
             hashCode = hashCode * 59 + FileName.GetHashCode();
         }
         hashCode = hashCode * 59 + ContentEncoding.GetHashCode();
         hashCode = hashCode * 59 + GetPreview.GetHashCode();
         hashCode = hashCode * 59 + ThumbnailWidth.GetHashCode();
         hashCode = hashCode * 59 + ThumbnailHeight.GetHashCode();
         if (ThumbnailBackgroundColor != null)
         {
             hashCode = hashCode * 59 + ThumbnailBackgroundColor.GetHashCode();
         }
         hashCode = hashCode * 59 + ThumbnailFitToPageSize.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Content != null)
         {
             hashCode = hashCode * 59 + Content.GetHashCode();
         }
         if (FileName != null)
         {
             hashCode = hashCode * 59 + FileName.GetHashCode();
         }
         if (Password != null)
         {
             hashCode = hashCode * 59 + Password.GetHashCode();
         }
         hashCode = hashCode * 59 + Conformance.GetHashCode();
         hashCode = hashCode * 59 + ContentEncoding.GetHashCode();
         hashCode = hashCode * 59 + EnableColorDetection.GetHashCode();
         hashCode = hashCode * 59 + GetPreview.GetHashCode();
         hashCode = hashCode * 59 + ThumbnailWidth.GetHashCode();
         hashCode = hashCode * 59 + ThumbnailHeight.GetHashCode();
         if (ThumbnailBackgroundColor != null)
         {
             hashCode = hashCode * 59 + ThumbnailBackgroundColor.GetHashCode();
         }
         hashCode = hashCode * 59 + ThumbnailFitToPageSize.GetHashCode();
         hashCode = hashCode * 59 + TxtPageWidth.GetHashCode();
         hashCode = hashCode * 59 + TxtPageHeight.GetHashCode();
         hashCode = hashCode * 59 + TxtPageMarginLeft.GetHashCode();
         hashCode = hashCode * 59 + TxtPageMarginTop.GetHashCode();
         hashCode = hashCode * 59 + TxtPageMarginRight.GetHashCode();
         hashCode = hashCode * 59 + TxtPageMarginBottom.GetHashCode();
         hashCode = hashCode * 59 + TxtHorizontalTextAlignment.GetHashCode();
         hashCode = hashCode * 59 + TxtFontSize.GetHashCode();
         if (TxtFontFamily != null)
         {
             hashCode = hashCode * 59 + TxtFontFamily.GetHashCode();
         }
         hashCode = hashCode * 59 + TxtFontBold.GetHashCode();
         hashCode = hashCode * 59 + TxtFontItalic.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Returns true if LoadImageFromByteArrayParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of LoadImageFromByteArrayParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LoadImageFromByteArrayParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Content == input.Content ||
                     (Content != null &&
                      Content.Equals(input.Content))
                     ) &&
                 (
                     FileName == input.FileName ||
                     (FileName != null &&
                      FileName.Equals(input.FileName))
                 ) &&
                 (
                     ContentEncoding == input.ContentEncoding ||
                     ContentEncoding.Equals(input.ContentEncoding)
                 ) &&
                 (
                     GetPreview == input.GetPreview ||
                     GetPreview.Equals(input.GetPreview)
                 ) &&
                 (
                     ThumbnailWidth == input.ThumbnailWidth ||
                     ThumbnailWidth.Equals(input.ThumbnailWidth)
                 ) &&
                 (
                     ThumbnailHeight == input.ThumbnailHeight ||
                     ThumbnailHeight.Equals(input.ThumbnailHeight)
                 ) &&
                 (
                     ThumbnailBackgroundColor == input.ThumbnailBackgroundColor ||
                     (ThumbnailBackgroundColor != null &&
                      ThumbnailBackgroundColor.Equals(input.ThumbnailBackgroundColor))
                 ) &&
                 (
                     ThumbnailFitToPageSize == input.ThumbnailFitToPageSize ||
                     ThumbnailFitToPageSize.Equals(input.ThumbnailFitToPageSize)
                 ));
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (FileId != null)
         {
             hashCode = hashCode * 59 + FileId.GetHashCode();
         }
         hashCode = hashCode * 59 + ThumbnailWidth.GetHashCode();
         hashCode = hashCode * 59 + ThumbnailHeight.GetHashCode();
         if (ThumbnailBackgroundColor != null)
         {
             hashCode = hashCode * 59 + ThumbnailBackgroundColor.GetHashCode();
         }
         hashCode = hashCode * 59 + ThumbnailFitToPageSize.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 6
0
        /// <summary>
        /// Save theme compatible with v1.5+
        /// </summary>
        /// <param name="dir"></param>
        public void SaveAsTheme(string dir)
        {
            XmlDocument doc   = new XmlDocument();
            XmlElement  root  = doc.CreateElement("ImageGlass"); //<ImageGlass>
            XmlElement  nType = doc.CreateElement("Theme");      //<Theme>

            XmlElement n = doc.CreateElement("Info");            // <Info>

            n.SetAttribute("name", name);
            n.SetAttribute("version", version);
            n.SetAttribute("author", author);
            n.SetAttribute("email", email);
            n.SetAttribute("website", website);
            n.SetAttribute("description", description);
            n.SetAttribute("type", "ImageGlass Theme Configuration");
            n.SetAttribute("compatibility", compatibility);
            n.SetAttribute("preview", Path.GetFileName(PreviewImage.Filename));
            nType.AppendChild(n);

            n = doc.CreateElement("main");// <main>
            n.SetAttribute("topbar", Path.GetFileName(ToolbarBackgroundImage.Filename));
            n.SetAttribute("topbarcolor", ToolbarBackgroundColor.ToArgb().ToString());
            n.SetAttribute("bottombar", Path.GetFileName(ThumbnailBackgroundImage.Filename));
            n.SetAttribute("bottombarcolor", ThumbnailBackgroundColor.ToArgb().ToString());
            n.SetAttribute("backcolor", BackgroundColor.ToArgb().ToString());
            n.SetAttribute("statuscolor", TextInfoColor.ToArgb().ToString());
            nType.AppendChild(n);

            n = doc.CreateElement("toolbar_icon");// <toolbar_icon>
            n.SetAttribute("back", Path.GetFileName(ToolbarIcons.ViewPreviousImage.Filename));
            n.SetAttribute("next", Path.GetFileName(ToolbarIcons.ViewNextImage.Filename));
            n.SetAttribute("leftrotate", Path.GetFileName(ToolbarIcons.RotateLeft.Filename));
            n.SetAttribute("rightrotate", Path.GetFileName(ToolbarIcons.RotateRight.Filename));
            n.SetAttribute("zoomin", Path.GetFileName(ToolbarIcons.ZoomIn.Filename));
            n.SetAttribute("zoomout", Path.GetFileName(ToolbarIcons.ZoomOut.Filename));
            n.SetAttribute("zoomlock", Path.GetFileName(ToolbarIcons.LockRatio.Filename));
            n.SetAttribute("scaletofit", Path.GetFileName(ToolbarIcons.ActualSize.Filename));
            n.SetAttribute("scaletowidth", Path.GetFileName(ToolbarIcons.ScaleToWidth.Filename));
            n.SetAttribute("scaletoheight", Path.GetFileName(ToolbarIcons.ScaleToHeight.Filename));
            n.SetAttribute("autosizewindow", Path.GetFileName(ToolbarIcons.AdjustWindowSize.Filename));
            n.SetAttribute("open", Path.GetFileName(ToolbarIcons.OpenFile.Filename));
            n.SetAttribute("refresh", Path.GetFileName(ToolbarIcons.Refresh.Filename));
            n.SetAttribute("gotoimage", Path.GetFileName(ToolbarIcons.GoToImage.Filename));
            n.SetAttribute("thumbnail", Path.GetFileName(ToolbarIcons.ThumbnailBar.Filename));
            n.SetAttribute("caro", Path.GetFileName(ToolbarIcons.CheckedBackground.Filename));
            n.SetAttribute("fullscreen", Path.GetFileName(ToolbarIcons.FullScreen.Filename));
            n.SetAttribute("slideshow", Path.GetFileName(ToolbarIcons.Slideshow.Filename));
            n.SetAttribute("convert", Path.GetFileName(ToolbarIcons.Convert.Filename));
            n.SetAttribute("print", Path.GetFileName(ToolbarIcons.Print.Filename));
            n.SetAttribute("uploadfb", Path.GetFileName(ToolbarIcons.Sharing.Filename));
            n.SetAttribute("extension", Path.GetFileName(ToolbarIcons.Plugins.Filename));
            n.SetAttribute("settings", Path.GetFileName(ToolbarIcons.Settings.Filename));
            n.SetAttribute("about", Path.GetFileName(ToolbarIcons.About.Filename));
            n.SetAttribute("menu", Path.GetFileName(ToolbarIcons.Menu.Filename));
            nType.AppendChild(n);

            root.AppendChild(nType);
            doc.AppendChild(root);

            //create temp directory of theme
            if (Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            doc.Save(Path.Combine(dir, "config.xml")); //save file
        }
        /// <summary>
        /// Returns true if PdfLoadDocumentParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of PdfLoadDocumentParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PdfLoadDocumentParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FileName == input.FileName ||
                     (FileName != null &&
                      FileName.Equals(input.FileName))
                     ) &&
                 (
                     Password == input.Password ||
                     (Password != null &&
                      Password.Equals(input.Password))
                 ) &&
                 (
                     Conformance == input.Conformance ||
                     Conformance.Equals(input.Conformance)
                 ) &&
                 (
                     ContentEncoding == input.ContentEncoding ||
                     ContentEncoding.Equals(input.ContentEncoding)
                 ) &&
                 (
                     EnableColorDetection == input.EnableColorDetection ||
                     EnableColorDetection.Equals(input.EnableColorDetection)
                 ) &&
                 (
                     GetPreview == input.GetPreview ||
                     GetPreview.Equals(input.GetPreview)
                 ) &&
                 (
                     ThumbnailWidth == input.ThumbnailWidth ||
                     ThumbnailWidth.Equals(input.ThumbnailWidth)
                 ) &&
                 (
                     ThumbnailHeight == input.ThumbnailHeight ||
                     ThumbnailHeight.Equals(input.ThumbnailHeight)
                 ) &&
                 (
                     ThumbnailBackgroundColor == input.ThumbnailBackgroundColor ||
                     (ThumbnailBackgroundColor != null &&
                      ThumbnailBackgroundColor.Equals(input.ThumbnailBackgroundColor))
                 ) &&
                 (
                     ThumbnailFitToPageSize == input.ThumbnailFitToPageSize ||
                     ThumbnailFitToPageSize.Equals(input.ThumbnailFitToPageSize)
                 ) &&
                 (
                     TxtPageWidth == input.TxtPageWidth ||
                     TxtPageWidth.Equals(input.TxtPageWidth)
                 ) &&
                 (
                     TxtPageHeight == input.TxtPageHeight ||
                     TxtPageHeight.Equals(input.TxtPageHeight)
                 ) &&
                 (
                     TxtPageMarginLeft == input.TxtPageMarginLeft ||
                     TxtPageMarginLeft.Equals(input.TxtPageMarginLeft)
                 ) &&
                 (
                     TxtPageMarginTop == input.TxtPageMarginTop ||
                     TxtPageMarginTop.Equals(input.TxtPageMarginTop)
                 ) &&
                 (
                     TxtPageMarginRight == input.TxtPageMarginRight ||
                     TxtPageMarginRight.Equals(input.TxtPageMarginRight)
                 ) &&
                 (
                     TxtPageMarginBottom == input.TxtPageMarginBottom ||
                     TxtPageMarginBottom.Equals(input.TxtPageMarginBottom)
                 ) &&
                 (
                     TxtHorizontalTextAlignment == input.TxtHorizontalTextAlignment ||
                     TxtHorizontalTextAlignment.Equals(input.TxtHorizontalTextAlignment)
                 ) &&
                 (
                     TxtFontSize == input.TxtFontSize ||
                     TxtFontSize.Equals(input.TxtFontSize)
                 ) &&
                 (
                     TxtFontFamily == input.TxtFontFamily ||
                     (TxtFontFamily != null &&
                      TxtFontFamily.Equals(input.TxtFontFamily))
                 ) &&
                 (
                     TxtFontBold == input.TxtFontBold ||
                     TxtFontBold.Equals(input.TxtFontBold)
                 ) &&
                 (
                     TxtFontItalic == input.TxtFontItalic ||
                     TxtFontItalic.Equals(input.TxtFontItalic)
                 ));
        }