Beispiel #1
0
        /// <summary>
        /// Löscht einen Link
        /// </summary>
        /// <param name="link"></param>
        public static void DeleteLink(Link link)
        {
            var result = MessageBox.Show(CommonText.LinkDeleteQuestion, CommonText.LinkDeleteTitle,MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
                DataStore.Instance.OnLinksDeleted(link.WrapInList());
        }
Beispiel #2
0
 /// <summary>
 /// Fügt einen Link hinzu
 /// </summary>
 /// <param name="link"></param>
 public static void EditLink(Link link)
 {
     if (DataStore.Instance.Links.Any(li => li.Guid.Equals(link.Guid)))
         DataStore.Instance.OnLinksChanged(link.WrapInList());
 }
Beispiel #3
0
 /// <summary>
 /// Fügt einen Link hinzu
 /// </summary>
 /// <param name="link"></param>
 public static void AddLink(Link link)
 {
     if(!DataStore.Instance.Links.Any(li => li.Uri.Equals(link.Uri)))
         DataStore.Instance.OnLinksAdded(link.WrapInList());
 }
Beispiel #4
0
        /// <summary>
        /// Öffnet den Link im Browser
        /// </summary>
        /// <param name="link"></param>
        public static void OpenLinkInDefaultBrowser(Link link)
        {
            try
            {
                System.Diagnostics.Process.Start(link.Uri);
                link.InvokeCount++;
                DataStore.Instance.OnLinksChanged(link.WrapInList());

            }
            catch (Exception e)
            {

                MessageBox.Show(e.Message, CommonText.Error, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }