Ejemplo n.º 1
0
        public override void Restore()
        {
            MullionType original = Original as MullionType;

            if (original == null)
            {
                throw new InvalidOperationException(
                          "View model does not have an original value.");
            }

            Id          = original.Id;
            Name        = original.Name;
            ProfileType = new ProfileTypeViewModel(original.ProfileType);
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            ProfileTypeViewModel pvm = obj as ProfileTypeViewModel;

            if (pvm == null)
            {
                return(false);
            }

            if (pvm.Id != Id)
            {
                return(false);
            }

            if (pvm.Name != Name)
            {
                return(false);
            }
            if (pvm.Thickness != Thickness)
            {
                return(false);
            }
            if (pvm.Shape != Shape)
            {
                return(false);
            }
            if (pvm.Length != Length)
            {
                return(false);
            }
            if (pvm.Weight != Weight)
            {
                return(false);
            }
            if (pvm.Price != null && !Price.Equals(pvm.Price))
            {
                return(false);
            }
            if (pvm.Tolerance != Tolerance)
            {
                return(false);
            }
            if (pvm.Description != Description)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public override void Restore()
        {
            SashType original = Original as SashType;

            if (original == null)
            {
                throw new InvalidOperationException(
                          "View model does not have an original value.");
            }
            Id          = original.Id;
            Name        = original.Name;
            ProfileType = new ProfileTypeViewModel(original.ProfileType);
            Tolerance   = original.Tolerance;
            Description = original.Description;
        }