예제 #1
0
        public PopulationTriggerEvent Copy()
        {
            Server.Application.PopulationTriggerEvent serverObject = (Server.Application.PopulationTriggerEvent)ToServerObject();

            PopulationTriggerEvent copiedObject = new PopulationTriggerEvent(application, serverObject);

            return(copiedObject);
        }
예제 #2
0
        public Boolean IsEqual(PopulationTriggerEvent compareEvent)
        {
            Boolean isEqual = true;

            if (this.eventType != compareEvent.EventType)
            {
                isEqual = false;
            }

            else
            {
                switch (this.eventType)
                {
                case Mercury.Server.Application.PopulationTriggerEventType.Service:

                    if (this.serviceId != compareEvent.ServiceId)
                    {
                        isEqual = false;
                    }

                    break;

                case Mercury.Server.Application.PopulationTriggerEventType.Metric:

                    if (this.metricType != compareEvent.metricType)
                    {
                        isEqual = false;
                    }

                    else
                    {
                        if (this.metricId != compareEvent.MetricId)
                        {
                            isEqual = false;
                        }

                        if (this.metricMaximum != compareEvent.MetricMaximum)
                        {
                            isEqual = false;
                        }

                        if (this.metricMaximum != compareEvent.MetricMaximum)
                        {
                            isEqual = false;
                        }
                    }

                    break;

                case Mercury.Server.Application.PopulationTriggerEventType.AuthorizedService:

                    if (this.authorizedServiceId != compareEvent.AuthorizedServiceId)
                    {
                        isEqual = false;
                    }

                    break;
                }
            }

            isEqual = isEqual && (problemStatementId == compareEvent.ProblemStatementId);

            if (isEqual)
            {
                isEqual = isEqual && action.IsEqual(compareEvent.action);
            }

            return(isEqual);
        }