public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || (o as PerformanceData) == null)
            {
                return(false);
            }

            var that = (PerformanceData)o;

            if (_eventTickCount != that._eventTickCount)
            {
                return(false);
            }
            if (CounterName != null ? !CounterName.Equals(that.CounterName) : that.CounterName != null)
            {
                return(false);
            }
            if (DeploymentId != null ? !DeploymentId.Equals(that.DeploymentId) : that.DeploymentId != null)
            {
                return(false);
            }
            if (Role != null ? !Role.Equals(that.Role) : that.Role != null)
            {
                return(false);
            }
            if (RoleInstance != null ? !RoleInstance.Equals(that.RoleInstance) : that.RoleInstance != null)
            {
                return(false);
            }

            return(true);
        }
예제 #2
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))));
        }