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); }
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); }
public QuestionType(OptionalInteger questionTypeId, OptionalInteger questionSubtypeId) { this.questionTypeId = questionTypeId; this.questionSubtypeId = questionSubtypeId; }
public QuestionType(BuisinessObjects.Subtype subtype) { this.questionTypeId = new OptionalInteger(); this.questionSubtypeId = new OptionalInteger((int)subtype); }
public QuestionType(Type type) { this.questionTypeId = new OptionalInteger((int)type); this.questionSubtypeId = new OptionalInteger(); }