Пример #1
0
        public void Draw(IGraphics g)
        {
            g.DrawCircle(Pens.Green, ViewPortExtent.GetCenterWidth(), ViewPortExtent.GetCenterHeight(), Radius);

            var dashedPen = new Pen(new SolidBrush(Color.FromArgb(0, 128, 0)))
            {
                DashStyle = DashStyle.Dot
            };

            for (int ringCounter = 0; ringCounter <= RangeRings; ringCounter++)
            {
                var newRadius = Radius - ((ringCounter + 1) * RingSep);
                if (newRadius > 0)
                {
                    g.DrawCircle(dashedPen, ViewPortExtent.GetCenterWidth(), ViewPortExtent.GetCenterHeight(), newRadius);
                }
            }

            BullsEye?.PaintMethod?.Invoke(g, BullsEye);
            HomePlate?.PaintMethod?.Invoke(g, HomePlate);

            var activeContacts = CurrentContacts.Where(cont => cont.Value?.Running ?? false == true)
                                 .ToList();

            activeContacts.ForEach(con => {
                IGraphics newContext = new GraphicsAdapter(g.Context);
                con.Value?.Draw(newContext);
            });
        }
Пример #2
0
        public void DeleteContact(Contact contact)
        {
            if (CurrentContacts.Contains(contact))
            {
                CurrentContacts.Remove(contact);
            }

            _contactRepository.Delete(contact);
            StatusText = $"Contact '{contact.LookupName}' was deleted.";
        }
Пример #3
0
        public void SaveContact(Contact contact)
        {
            if (!CurrentContacts.Contains(contact))
            {
                CurrentContacts.Add(contact);
            }

            _contactRepository.Save(contact);
            StatusText = $"Contact '{contact.LookupName}' was saved.";
        }
        public void DeleteContact(Contact contact)
        {
            if (CurrentContacts.Contains(contact))
            {
                CurrentContacts.Remove(contact);
            }

            _contactRepository.Delete(contact);
            StatusText = string.Format("Contact ‘{0}’ was deleted.", contact.LookupName);
        }
        public void SaveContact(Contact contact)
        {
            if (!CurrentContacts.Contains(contact))
            {
                CurrentContacts.Add(contact);
            }

            _contactRepository.Save(contact);
            StatusText = string.Format("Contact ‘{0}’ was saved.", contact.LookupName);
        }
        public void SaveContact(Contact contact)
        {
            if (!CurrentContacts.Contains(contact))
            {
                CurrentContacts.Add(contact);
            }

            _contactRepository.Save(contact);

            string statusMessage = string.Format(
                "Contact <{0}> was saved.",
                contact.LookupName
                );

            UpdateStatusText(statusMessage);
        }
        public void DeleteContact(Contact contact)
        {
            if (CurrentContacts.Contains(contact))
            {
                CurrentContacts.Remove(contact);
            }

            _contactRepository.Delete(contact);

            string statusMessage = string.Format(
                "Contact <{0}> was deleted.",
                contact.LookupName
                );

            UpdateStatusText(statusMessage);
        }
Пример #8
0
        void OnTextBoxLabelTextChanged(object sender, EventArgs e)
        {
            OverwriteIndex = CurrentContacts.IndexOfLabel(Label);

            if (OverwriteIndex >= 0 && OverwriteIndex != EditIndex)
            {
                // Notify the user of the overwriting operation
                TextBoxLabel.TextColor = Utilities.ColorForegroundWarning;
            }
            else
            {
                TextBoxLabel.TextColor = Utilities.ColorForegroundDefault;
            }

            CheckInputsValidity();
        }
Пример #9
0
 /// <summary>
 /// Adds a point as a type and class of contact
 /// </summary>
 /// <param name="newContact">Relative position from (0,0) <see cref="IContact"/></param>
 public void AddContact(IContact newContact)
 {
     if (CurrentContacts == null)
     {
         CurrentContacts = new SortedList <Guid, IContact>();
     }
     if (!CurrentContacts.ContainsKey(newContact.UniqueId))
     {
         CurrentContacts.Add(newContact.UniqueId, newContact);
         // newContact.UpdateRegion += Contact_UpdatePending;
         Logger.Debug($"Added contact: {newContact}");
     }
     else
     {
         Logger.Warn($"Already found reference to contact {newContact}");
     }
 }