Example #1
0
        public void RemoveContent(DarkDockContent dockContent)
        {
            if (!_contents.Contains(dockContent))
            {
                return;
            }

            // check if no cancelled
            Boolean cancel = new Boolean(false);

            ContentRemoving?.Invoke(this, new DockContentRemovingEventArgs(dockContent, cancel));
            if (cancel.Value)
            {
                return;
            }

            dockContent.DockPanel = null;
            _contents.Remove(dockContent);

            var region = _regions[dockContent.DockArea];

            region.RemoveContent(dockContent);

            ContentRemoved?.Invoke(this, new DockContentEventArgs(dockContent));
        }
 private void fire_ContentRemoved(InputTypes type, string title, string input)
 {
     if (ContentRemoved != null)
     {
         try
         {
             ContentRemoved.Invoke(this, new InputEventArgs(type, title, input));
         }
         catch { }
     }
 }
Example #3
0
        public void RemoveContent(DarkDockContent dockContent)
        {
            if (!_contents.Contains(dockContent))
            {
                return;
            }

            dockContent.DockPanel = null;
            _contents.Remove(dockContent);

            var region = _regions[dockContent.DockArea];

            region.RemoveContent(dockContent);

            ContentRemoved?.Invoke(this, new DockContentEventArgs(dockContent));
        }
Example #4
0
        /// <summary>
        /// Returns true if PdfReduceResponse instances are equal
        /// </summary>
        /// <param name="input">Instance of PdfReduceResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PdfReduceResponse input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Error == input.Error ||
                     (Error != null &&
                      Error.Equals(input.Error))
                     ) &&
                 (
                     RemainingTokens == input.RemainingTokens ||
                     RemainingTokens.Equals(input.RemainingTokens)
                 ) &&
                 (
                     ErrorInfo == input.ErrorInfo ||
                     (ErrorInfo != null &&
                      ErrorInfo.Equals(input.ErrorInfo))
                 ) &&
                 (
                     WarningsInfo == input.WarningsInfo ||
                     WarningsInfo != null &&
                     input.WarningsInfo != null &&
                     WarningsInfo.SequenceEqual(input.WarningsInfo)
                 ) &&
                 (
                     ContentRemoved == input.ContentRemoved ||
                     ContentRemoved.Equals(input.ContentRemoved)
                 ) &&
                 (
                     VersionChanged == input.VersionChanged ||
                     VersionChanged.Equals(input.VersionChanged)
                 ) &&
                 (
                     NewFileSize == input.NewFileSize ||
                     NewFileSize.Equals(input.NewFileSize)
                 ));
        }
Example #5
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 (Error != null)
         {
             hashCode = hashCode * 59 + Error.GetHashCode();
         }
         hashCode = hashCode * 59 + RemainingTokens.GetHashCode();
         if (ErrorInfo != null)
         {
             hashCode = hashCode * 59 + ErrorInfo.GetHashCode();
         }
         if (WarningsInfo != null)
         {
             hashCode = hashCode * 59 + WarningsInfo.GetHashCode();
         }
         hashCode = hashCode * 59 + ContentRemoved.GetHashCode();
         hashCode = hashCode * 59 + VersionChanged.GetHashCode();
         hashCode = hashCode * 59 + NewFileSize.GetHashCode();
         return(hashCode);
     }
 }