예제 #1
0
        public bool Equals(BpmnDefinition other)
        {
            // Check for null
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            // Check for same reference
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            // Not Check DeploymentId, because generated Guid

            // Check for same value
            return(((DeploymentId == null && other.DeploymentId == null) || (DeploymentId != null && other.DeploymentId != null && DeploymentId.Equals(other.DeploymentId))) &&
                   ((Name == null && other.Name == null) || (Name != null && other.Name != null && Name.Equals(other.Name))) &&
                   ((DefinitionKey == null && other.DefinitionKey == null) || (DefinitionKey != null && other.DefinitionKey != null && DefinitionKey.Equals(other.DefinitionKey))) &&
                   ((ProcessDefinitionDescription == null && other.ProcessDefinitionDescription == null) || (ProcessDefinitionDescription != null && other.ProcessDefinitionDescription != null && ProcessDefinitionDescription.Equals(other.ProcessDefinitionDescription))) &&
                   ((ProcessDefinitionDiagramResourceName == null && other.ProcessDefinitionDiagramResourceName == null) || (ProcessDefinitionDiagramResourceName != null && other.ProcessDefinitionDiagramResourceName != null && ProcessDefinitionDiagramResourceName.Equals(other.ProcessDefinitionDiagramResourceName))) &&
                   (ProcessDefinitionHasStartFormKey.Equals(other.ProcessDefinitionHasStartFormKey)) &&
                   (ProcessDefinitionHasGraphicalNotation.Equals(other.ProcessDefinitionHasGraphicalNotation)) &&
                   (IsSuspended.Equals(other.IsSuspended)) &&
                   ((TenantId == null && other.TenantId == null) || (TenantId != null && other.TenantId != null && TenantId.Equals(other.TenantId))));
        }
예제 #2
0
 /// <summary>
 /// This function will run on different thread than UI. Make sure to use Invoke for interface update.
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 void QueueTimer_DoWork(object sender, QueueTimerEventArgs e)
 {
     // Return if suspended function is not set.
     if (IsSuspended?.Invoke() ?? true)
     {
         return;
     }
     CheckAll();
     // Update list will affect Warnings list, which is bound to MainDataGrid on UI,
     // therefore use Invoke to make sure that it runs on the same thread as UI.
     ControlsHelper.Invoke(() =>
     {
         UpdateDisplayedList();
     });
 }
예제 #3
0
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hash = (Key != null) ? Key.GetHashCode() : 0;
         // Suitable nullity checks etc, of course :)
         hash = (DeploymentId != null) ? hash * 17 + DeploymentId.GetHashCode() : hash;
         hash = (Name != null) ? hash * 17 + Name.GetHashCode() : hash;
         hash = (DefinitionKey != null) ? hash * 17 + DefinitionKey.GetHashCode() : hash;
         hash = (ProcessDefinitionDescription != null) ? hash * 17 + ProcessDefinitionDescription.GetHashCode() : hash;
         hash = (ProcessDefinitionResource != null) ? hash * 17 + ProcessDefinitionResource.GetHashCode() : hash;
         hash = (ProcessDefinitionDiagramResourceName != null) ? hash * 17 + ProcessDefinitionDiagramResourceName.GetHashCode() : hash;
         hash = hash * 17 + ProcessDefinitionHasStartFormKey.GetHashCode();
         hash = hash * 17 + ProcessDefinitionHasGraphicalNotation.GetHashCode();
         hash = hash * 17 + IsSuspended.GetHashCode();
         hash = (TenantId != null) ? hash * 17 + TenantId.GetHashCode() : hash;
         return(hash);
     }
 }
예제 #4
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 (MerchantSuppliedId != null)
         {
             hashCode = hashCode * 59 + MerchantSuppliedId.GetHashCode();
         }
         if (IsSuspended != null)
         {
             hashCode = hashCode * 59 + IsSuspended.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         return(hashCode);
     }
 }
예제 #5
0
        /// <summary>
        /// Returns true if UpdateItem instances are equal
        /// </summary>
        /// <param name="input">Instance of UpdateItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(UpdateItem input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     MerchantSuppliedId == input.MerchantSuppliedId ||
                     MerchantSuppliedId != null &&
                     MerchantSuppliedId.Equals(input.MerchantSuppliedId)
                     ) &&
                 (
                     IsSuspended == input.IsSuspended ||
                     IsSuspended != null &&
                     IsSuspended.Equals(input.IsSuspended)
                 ) &&
                 (
                     Price == input.Price ||
                     Price != null &&
                     Price.Equals(input.Price)
                 ));
        }