Ejemplo n.º 1
0
 public void FromAnotherObject(IdBasedObject obj)
 {
     foreach (var c in _columns)
     {
         if (obj._columns.Contains(c) && obj[c].ToString() != this[c].ToString())
         {
             this[c] = obj[c];
         }
     }
 }
Ejemplo n.º 2
0
 void Init(HOST host)
 {
     ID      = host.id;
     NAME    = host.name;
     STARTED = IdBasedObject.DateTimeToString(host.STARTED);
     PCPING  = IdBasedObject.DateTimeToString(host.pcping);
     INFO    = host.systeminfo;
     IP      = host.ip;
     MAC     = host.mac;
 }
Ejemplo n.º 3
0
 public void FromAnotherObject(IdBasedObject obj)
 {
     foreach (var c in _columns)
     {
         if (obj._columns.Contains(c))
         {
             string newval = obj[c].ToString();
             string oldval = this[c].ToString();
             if (oldval != newval)
             {
                 OnSetColFromCopy(c, oldval, newval);
                 this[c] = obj[c];
             }
         }
     }
 }
Ejemplo n.º 4
0
        private void SetPlannedTVIToSelect_IfMatch(ref TreeViewItem plannedSelectionTVI, IdBasedObject previouslySelectedDto, TreeViewItem prospectTVI, IdBasedObject prospectDto)
        {
            // If there is already a TVI planned to be selected
            if (plannedSelectionTVI != null)
            {
                return;
            }

            // If either of the Dtos are null then don't choose this node, the code will manually
            // select the "All Systems" node above if this ends up being the case for everything
            if (previouslySelectedDto == null || prospectDto == null)
            {
                return;
            }

            var previousType = previouslySelectedDto.GetType().Name;
            var prospectType = prospectDto.GetType().Name;

            // If the previous Dto is the not same type as the prospect, then it is not a match
            if (previousType.Equals(prospectType) == false)
            {
                return;
            }

            // We know the Dto types match, now just compare the ids to see if it is the same record
            if (previouslySelectedDto.Id == prospectDto.Id)
            {
                plannedSelectionTVI = prospectTVI;
            }
        }
Ejemplo n.º 5
0
 public TreeViewTag(IdBasedObject dto)
 {
     this.Dto = dto;
 }