Ejemplo n.º 1
0
        private static void LoadAll()
        {
            _notifications = new Dictionary<string, NotificationInfoClass>();
            string name = PockeTwit.Localization.XmlBasedResourceManager.GetString("PockeTwit: Friends Update");
            var friends = new NotificationInfoClass {Name = name, Group = null, GUID = FriendsTweets, Type= TimelineManagement.TimeLineType.Friends};
            name = PockeTwit.Localization.XmlBasedResourceManager.GetString("PockeTwit: Messages");
            var messages = new NotificationInfoClass{Name = name, Group = null, GUID = MessageTweets, Type=TimelineManagement.TimeLineType.Messages};

            _notifications.Add(FriendsTweets, friends);
            _notifications.Add(MessageTweets, messages);

            foreach (var line in SpecialTimeLinesRepository.GetList())
            {
                AddSpecialTimeLineNotifications(line);
            }

            LoadAllRegistries();
        }
Ejemplo n.º 2
0
 public static void AddSpecialTimeLineNotifications(ISpecialTimeLine line)
 {
     if (!_notifications.ContainsKey(line.name))
     {
         var c = new NotificationInfoClass
                                       {
                                           Name = "PockeTwit: " + line.name,
                                           Group = line,
                                           GUID = line.name,
                                           // Need to make sure we're checking searches if this is a saved search timeline
                                           Type = (line.Timelinetype == SpecialTimelines.SpecialTimeLinesRepository.TimeLineType.UserGroup) ? TimelineManagement.TimeLineType.Friends : TimelineManagement.TimeLineType.Searches
                                       };
         _notifications.Add(c.GUID, c);
         LoadAllRegistries();
     }
 }
Ejemplo n.º 3
0
        public static void SaveSettings(NotificationInfoClass infoSet)
        {
            RegistryKey theKey = Registry.CurrentUser.OpenSubKey("\\ControlPanel\\Notifications\\" + infoSet.GUID, true) ??
                                 Registry.CurrentUser.CreateSubKey("\\ControlPanel\\Notifications\\" + infoSet.GUID);
            if (infoSet.Sound != null)
            {
                if (theKey != null) theKey.SetValue("Wave", infoSet.Sound);
            }

            if (theKey != null) theKey.SetValue("Options", (int)infoSet.Options);
        }
Ejemplo n.º 4
0
        public static void LoadSettings(NotificationInfoClass infoClass, RegistryKey key)
        {
            try
            {
                infoClass.Sound = (string)key.GetValue("Wave");
                if (infoClass.Sound == null)
                {
                    key.SetValue("Wave", "");
                }
                if (key.GetValue("Options") != null)
                {
                    infoClass.Options = (Options)key.GetValue("Options");
                }
                else
                {
                    key.SetValue("Options", 0);
                }

            }
            catch (NullReferenceException)
            {
            }
        }
Ejemplo n.º 5
0
 public static void SaveSettings(NotificationInfoClass InfoSet)
 {
     RegistryKey TheKey = Registry.CurrentUser.OpenSubKey("\\ControlPanel\\Notifications\\" + InfoSet.GUID, true);
     if (TheKey == null)
     {
         TheKey = Registry.CurrentUser.CreateSubKey("\\ControlPanel\\Notifications\\" + InfoSet.GUID);
     }
     if (InfoSet.Sound != null)
     {
         TheKey.SetValue("Wave", InfoSet.Sound);
     }
     
     TheKey.SetValue("Options", (int)InfoSet.Options);
 }
Ejemplo n.º 6
0
 public static void AddSpecialTimeLineNotifications(SpecialTimeLine line)
 {
     if (!Notifications.ContainsKey(line.name))
     {
         NotificationInfoClass c = new NotificationInfoClass
         {
             Name = "PockeTwit: " + line.name,
             Group = line,
             GUID = line.name,
             Type = TimelineManagement.TimeLineType.Friends
         };
         Notifications.Add(c.GUID, c);
         LoadAllRegistries();
     }
 }
Ejemplo n.º 7
0
        private void LoadAll()
        {
            Notifications = new Dictionary<string, NotificationInfoClass>();
            NotificationInfoClass Friends = new NotificationInfoClass {Name = "PockeTwit: Friends Update", Group = null, GUID = FriendsTweets, Type= TimelineManagement.TimeLineType.Friends};
            NotificationInfoClass Messages = new NotificationInfoClass{Name = "PockeTwit: Messages", Group = null, GUID = MessageTweets, Type=TimelineManagement.TimeLineType.Messages};

            Notifications.Add(FriendsTweets, Friends);
            Notifications.Add(MessageTweets, Messages);

            foreach (var line in SpecialTimeLines.GetList())
            {
                AddSpecialTimeLineNotifications(line);
            }

            LoadAllRegistries();
        }