示例#1
0
 public Construct(Interview interview)
 {
     this.ParentInterview = interview;
     this.ConstructPol    = "<Construct Pole>";
     this.ContrastPol     = "<Contrast Pole>";
     this.Name            = "<Construct Name>";
     this.Remark          = "";
     this.ResetHasChanges();
 }
示例#2
0
 public ScaleItem(Interview parent, int iValue, string sName)
 {
     this.ParentInterview = parent;
     if (this.ParentInterview.Scales.Any(x => x.id == iValue) == false)
     {
         this.ParentInterview.Scales.Add(this);
     }
     this.Id   = iValue;
     this.Name = sName;
     this.ResetHasChanges();
 }
示例#3
0
 public ScaleItem(Interview parent, XElement xe)
 {
     this.Id = int.Parse(xe.Attribute("Id").Value);
     this.ParentInterview = parent;
     if (this.ParentInterview.Scales.Any(x => x.id == this.Id) == false)
     {
         this.ParentInterview.Scales.Add(this);
     }
     this.Name = xe.Attribute("Name").Value;
     this.ResetHasChanges();
 }
示例#4
0
        public override bool Equals(object obj)
        {
            if (obj.GetType() == this.GetType())
            {
                Interview ic     = (Interview)obj;
                Boolean   result = true;

                result =
                    this.GridName == ic.GridName &&
                    this.Proband == ic.Proband &&
                    this.Remark == ic.Remark &&
                    this.Date.ToString() == ic.Date.ToString() &&
                    this.Id.Equals(ic.Id)
                ;

                if (!result)
                {
                    return(false);
                }
                Predicate <Construct>     p = new Predicate <Construct>(x => ic.Constructs.Any(y => y.Id.Equals(x.Id)));
                Func <Construct, Boolean> f = new Func <Construct, bool>(x => p(x));

                result = result && this.Constructs.All(x => p(x) &&
                                                       ic.Constructs.Where(a => p(a)).Count() == 1 &&
                                                       x.Equals(ic.Constructs.Single(y => p(y))));

                if (!result)
                {
                    return(false);
                }
                p      = new Predicate <Construct>(x => this.Constructs.Any(y => y.Id.Equals(x.Id)));
                f      = new Func <Construct, bool>(x => p(x));
                result = result && ic.Constructs.All(x => p(x) &&
                                                     this.Constructs.Where(a => p(a)).Count() == 1 &&
                                                     x.Equals(this.Constructs.Single(y => p(y))));


                if (!result)
                {
                    return(false);
                }
                result = result && this.Elements.All(x => ic.Elements.Any(y => y.Id.Equals(x.Id)) &&
                                                     x.Equals(ic.Elements.Single(y => y.Id.Equals(x.Id))));

                result = result && ic.Elements.All(x => this.Elements.Any(y => y.Id.Equals(x.Id)) &&
                                                   x.Equals(this.Elements.Single(y => y.Id.Equals(x.Id))));


                if (!result)
                {
                    return(false);
                }
                result = result && this.Scales.All(x => ic.Scales.Any(y => y.Id.Equals(x.Id)) &&
                                                   x.Equals(ic.Scales.Single(y => y.Id.Equals(x.Id))));
                if (!result)
                {
                    return(false);
                }
                result = result && ic.Scales.All(x => this.Scales.Any(y => y.Id.Equals(x.Id)) &&
                                                 x.Equals(this.Scales.Single(y => y.Id.Equals(x.Id))));

                if (!result)
                {
                    return(false);
                }
                /* */
                return(result);
            }

            return(false);
        }
示例#5
0
 public Element(Interview interview)
 {
     this.ParentInterview = interview;
 }