Finish locking items in location. Can no longer move them if they are locked.
This commit is contained in:
		@@ -575,7 +575,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
                if (tItem is NetworkDevice)
 | 
			
		||||
                {
 | 
			
		||||
                    tDevice = (NetworkDevice)tItem;
 | 
			
		||||
                    if (tDevice.GetNetType() == NetworkComponentType.tree) continue; //Cannot select trees
 | 
			
		||||
                    if (tDevice.IsLockedInLocation()) continue; //some items cannot be moved
 | 
			
		||||
                    int tsize = tDevice.Size;
 | 
			
		||||
                    tPoint = tDevice.myLocation();
 | 
			
		||||
                    if (tPoint.X + tsize >= area.X && tPoint.Y +tsize >= area.Y)
 | 
			
		||||
 
 | 
			
		||||
@@ -1661,10 +1661,13 @@ namespace EduNetworkBuilder
 | 
			
		||||
                {
 | 
			
		||||
                    if (Math.Abs(ClickedLocation.X - ClickLocation.X) > 5 || Math.Abs(ClickedLocation.Y - ClickLocation.Y) > 5)
 | 
			
		||||
                    {
 | 
			
		||||
                        ItemClickedOn.ChangeLocation(CenteredLocation);
 | 
			
		||||
                        ItemClickedOn.UnHide(); //If it was hidden, unhide it
 | 
			
		||||
                        UpdateLinks();
 | 
			
		||||
                        UpdateVisuals();
 | 
			
		||||
                        if (!ItemClickedOn.IsLockedInLocation())
 | 
			
		||||
                        {
 | 
			
		||||
                            ItemClickedOn.ChangeLocation(CenteredLocation);
 | 
			
		||||
                            ItemClickedOn.UnHide(); //If it was hidden, unhide it
 | 
			
		||||
                            UpdateLinks();
 | 
			
		||||
                            UpdateVisuals();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -1769,7 +1772,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
            {
 | 
			
		||||
                //find where we are
 | 
			
		||||
                TimeSpan HowLong =  DateTime.UtcNow - LastMouseDown;
 | 
			
		||||
                if(HowLong.TotalMilliseconds > 100)
 | 
			
		||||
                if(HowLong.TotalMilliseconds > 100 && !ItemClickedOn.IsLockedInLocation())
 | 
			
		||||
                    DragItemToNewLocation(ItemClickedOn, CenteredLocation);
 | 
			
		||||
             }
 | 
			
		||||
            else if (MouseIsDown && ItemsSelected.Count >0) //dragging multiple items around
 | 
			
		||||
 
 | 
			
		||||
@@ -459,6 +459,14 @@ namespace EduNetworkBuilder
 | 
			
		||||
            writer.WriteEndElement();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool IsLockedInLocation()
 | 
			
		||||
        {
 | 
			
		||||
            if (myType == NetworkComponentType.tree) return true; //Trees are always stationary
 | 
			
		||||
            Network myNet = NB.GetNetwork();
 | 
			
		||||
            if (myNet.ItemHasTest(hostname, NetTestType.LockLocation)) return true;
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void SetDNSServer(bool isDNS)
 | 
			
		||||
        {
 | 
			
		||||
            isDNSServer = isDNS;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user