Beispiel #1
0
        public ContactTagViewModel(IContactTagLocal tag)
        {
            _tag = tag;

            Name     = tag.Name;
            Color    = ParseColor(tag.Color);
            ReadOnly = tag.AddressBook.ReadOnly;
        }
Beispiel #2
0
        internal void RemoveTag(IContactTagLocal tag)
        {
            if (ReadOnly)
            {
                return;
            }

            try
            {
                _instance.RemoveTag(tag.Key);
            }
            catch (Exception ex)
            {
                Logger.LogWarn(ex, "Can't remove tag from address book '{0}'.", Name);
            }
        }
Beispiel #3
0
        internal void AddTag(IContactTagLocal tag)
        {
            if (tag == null)
            {
                return;
            }
            if (SelectedContactInfo == null)
            {
                return;
            }
            if (SelectedContactInfo.Tags.Any(x => x.Id == tag.Id))
            {
                return;
            }

            SelectedContactInfo.Tags.Add(tag);

            NotifyPropertyChanged("Tags");
        }