Example #1
0
 /// <summary>
 /// Creates deep copy of identified object
 /// </summary>
 public IdentifiedObject(IdentifiedObject obj)
 {
     Description = obj.Description;
     GID         = obj.GID;
     MRID        = obj.MRID;
     Name        = obj.Name;
 }
        public void GetDifferentProperties(IdentifiedObject compared, out List <Property> valuesInOriginal, out List <Property> valuesInCompared)
        {
            valuesInCompared = new List <Property>();
            valuesInOriginal = new List <Property>();

            ResourceDescription rd = this.GetAsResourceDescription(false);

            if (compared != null)
            {
                ResourceDescription rdCompared = compared.GetAsResourceDescription(false);

                for (int i = 0; i < rd.Properties.Count; i++)
                {
                    if (rd.Properties[i] != rdCompared.Properties[i])
                    {
                        valuesInOriginal.Add(rd.Properties[i]);
                        valuesInCompared.Add(rdCompared.Properties[i]);
                    }
                }
            }
            else
            {
                for (int i = 0; i < rd.Properties.Count; i++)
                {
                    valuesInOriginal.Add(rd.Properties[i]);
                }
            }
        }
        public override IdentifiedObject DeepCopy(IdentifiedObject copy = null)
        {
            if (copy == null)
            {
                copy = new PowerSystemResource(this.GlobalId);
            }

            return(base.DeepCopy(copy));
        }
Example #4
0
        public override IdentifiedObject DeepCopy(IdentifiedObject copy = null)
        {
            if (copy == null)
            {
                copy = new ConductingEquipment(this.GlobalId);
            }

            return(base.DeepCopy(copy));
        }
Example #5
0
 public override IdentifiedObject DeepCopy(IdentifiedObject copy = null)
 {
     if (copy == null)
     {
         copy = new GeographicalRegion(this.GlobalId);
     }
     ((GeographicalRegion)copy).subRegions.AddRange(subRegions);
     return(base.DeepCopy(copy));
 }
Example #6
0
        public virtual object Clone()
        {
            IdentifiedObject io = new IdentifiedObject();

            io.Name      = this.Name;
            io.Mrid      = this.Mrid;
            io.AliasName = this.AliasName;
            return(io);
        }
Example #7
0
 public override IdentifiedObject DeepCopy(IdentifiedObject copy = null)
 {
     if (copy == null)
     {
         copy = new Equipment(this.GlobalId);
     }
     ((Equipment)copy).NormallyInService  = this.NormallyInService;
     ((Equipment)copy).EquipmentContainer = this.EquipmentContainer;
     return(base.DeepCopy(copy));
 }
Example #8
0
 public override IdentifiedObject DeepCopy(IdentifiedObject copy = null)
 {
     if (copy == null)
     {
         copy = new Substation(this.GlobalId);
     }
     ((Substation)copy).subRegion = this.subRegion;
     ((Substation)copy).latitude  = this.latitude;
     ((Substation)copy).longitude = this.longitude;
     return(base.DeepCopy(copy));
 }
Example #9
0
        public virtual IdentifiedObject DeepCopy(IdentifiedObject copy = null)
        {
            if (copy == null)
            {
                copy = new IdentifiedObject(this.GlobalId);
            }
            copy.mrid = this.mrid;
            copy.name = this.name;

            return(copy);
        }
Example #10
0
 public override bool Equals(object x)
 {
     if (Object.ReferenceEquals(x, null))
     {
         return(false);
     }
     else
     {
         IdentifiedObject io = (IdentifiedObject)x;
         return((io.GlobalId == this.GlobalId) && (io.description == this.description) && (io.mrid == this.mrid) && (io.name == this.name));
     }
 }
Example #11
0
 public override bool Equals(object x)
 {
     if (Object.ReferenceEquals(x, null))
     {
         return(false);
     }
     else
     {
         IdentifiedObject io = (IdentifiedObject)x;
         return(io.GlobalId == this.GlobalId);
     }
 }
 public override bool Equals(object obj)
 {
     if (Object.ReferenceEquals(obj, null))
     {
         return(false);
     }
     else
     {
         IdentifiedObject x = (IdentifiedObject)obj;
         return((x.GlobalId == this.GlobalId) && (x.AliasName == this.AliasName) && (x.Mrid == this.Mrid) && (x.Name == this.Name));
     }
 }
Example #13
0
 public override bool Equals(object x)
 {
     if (Object.ReferenceEquals(x, null))
     {
         return(false);
     }
     else
     {
         IdentifiedObject io = (IdentifiedObject)x;
         return((io.GID == this.GID) && (io.Name == this.Name) && (io.MRID == this.MRID) &&
                (io.Description == this.Description));
     }
 }
Example #14
0
 public override IdentifiedObject DeepCopy(IdentifiedObject copy)
 {
     return(base.DeepCopy(copy));
 }