Exemplo n.º 1
0
        public bool Equals(MPowerDevice other)
        {
            if (this == other)
            {
                return true;
            }

            return Id == other.Id &&
                Name == other.Name &&
                Username == other.Username &&
                Password == other.Password &&
                DeviceIP == other.DeviceIP &&
                EnabledPorts.SetEquals(other.EnabledPorts) &&
                EnabledTypes.SetEquals(other.EnabledTypes) &&
                ((Resolution.Count == other.Resolution.Count) &&
                 !Resolution.Except(other.Resolution).Any());
        }
Exemplo n.º 2
0
        public static bool Add(ApplicationDbContext context, string title, Types type, int records, TagType tag_type, EnabledTypes isenabled, string term)
        {
            if (title == null || title.Length < 3)
            {
                return(false);
            }

            var _entity = new JGN_Tags()
            {
                title     = title,
                type      = (byte)type,
                records   = records,
                tag_type  = (byte)tag_type,
                isenabled = (byte)isenabled,
                term      = term
            };

            context.Entry(_entity).State = EntityState.Added;

            context.SaveChanges();

            return(true);
        }
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("WebhookSettings(");
            bool          __first = true;

            if (Secret != null && __isset.secret)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Secret: ");
                __sb.Append(Secret);
            }
            if (Endpoint != null && __isset.endpoint)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Endpoint: ");
                __sb.Append(Endpoint);
            }
            if (__isset.enabled)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Enabled: ");
                __sb.Append(Enabled);
            }
            if (EnabledTypes != null && __isset.enabledTypes)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("EnabledTypes: ");
                __sb.Append(EnabledTypes.ToDebugString());
            }
            if (DisabledReason != null && __isset.disabledReason)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("DisabledReason: ");
                __sb.Append(DisabledReason);
            }
            if (__isset.disabledTimestamp)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("DisabledTimestamp: ");
                __sb.Append(DisabledTimestamp);
            }
            __sb.Append(")");
            return(__sb.ToString());
        }