Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }
            OptionalInteger arg = (OptionalInteger)obj;

            if (this.hasValue != arg.hasValue)
            {
                return(false);
            }

            if (!this.hasValue)
            {
                return(true);
            }
            return(this.value == arg.value);
        }
Esempio n. 2
0
        public int CompareTo(object obj)
        {
            if (!(obj is OptionalInteger))
            {
                throw new ArgumentException("Argument is not an OptionalInteger", "obj");
            }
            OptionalInteger arg = (OptionalInteger)obj;

            if (this.hasValue != arg.hasValue)
            {
                return(this.hasValue ? 1 : -1);
            }

            if (!this.hasValue)
            {
                return(0);
            }
            if (this.value == arg.value)
            {
                return(0);
            }

            return(this.value > arg.value ? 1 : -1);
        }
Esempio n. 3
0
 public QuestionType(OptionalInteger questionTypeId, OptionalInteger questionSubtypeId)
 {
     this.questionTypeId    = questionTypeId;
     this.questionSubtypeId = questionSubtypeId;
 }
Esempio n. 4
0
 public QuestionType(BuisinessObjects.Subtype subtype)
 {
     this.questionTypeId    = new OptionalInteger();
     this.questionSubtypeId = new OptionalInteger((int)subtype);
 }
Esempio n. 5
0
 public QuestionType(Type type)
 {
     this.questionTypeId    = new OptionalInteger((int)type);
     this.questionSubtypeId = new OptionalInteger();
 }