Exemplo n.º 1
0
        public SharpReaderImporter()
        {
            bool   SharpReaderFound = false;
            string basePath         = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string sharpPath        = Path.Combine(basePath, @"SharpReader");

            _subscriptionPath = Path.Combine(sharpPath, "subscriptions.xml");
            if (File.Exists(_subscriptionPath))
            {
                SharpReaderFound = true;
            }

            if (!SharpReaderFound)
            {
                // don't build additional data structures
                return;
            }

            _plugin.RegisterFeedImporter("SharpReader", this);
            // Calculate cache dir
            _cachePath = Path.Combine(sharpPath, "Cache");

            // Build flags hash
            _defaultFlag = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "RedFlag");
            for (int i = 0; i < _flagsIDs.Length; ++i)
            {
                _flagsMap[i.ToString()] = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", _flagsIDs[i]);
            }
        }
Exemplo n.º 2
0
        public RssBanditImporter()
        {
            bool   RssBanditFound = false;
            string basePath       = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            string banditPath     = Path.Combine(basePath, @"RssBandit");

            _subscriptionPath = Path.Combine(banditPath, "subscriptions.xml");
            if (File.Exists(_subscriptionPath))
            {
                RssBanditFound = true;
            }
            if (!RssBanditFound)
            {
                _subscriptionPath = Path.Combine(banditPath, "feedlist.xml");
                if (File.Exists(_subscriptionPath))
                {
                    RssBanditFound = true;
                }
            }
            if (!RssBanditFound)
            {
                // don't build additional data structures
                return;
            }

            _plugin.RegisterFeedImporter("RSS Bandit", this);
            // Calculate cache dir
            _cachePath = Path.Combine(banditPath, "Cache");
            // Try find flagged feed
            _flaggedPath = Path.Combine(banditPath, "flagitems.xml");
            if (!File.Exists(_flaggedPath))
            {
                // No stream with flags, Ok.
                _flaggedPath = null;
            }
            // Build flags hash
            _defaultFlag          = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "RedFlag");
            _flagsMap["FollowUp"] = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "RedFlag");
            _flagsMap["Review"]   = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "YellowFlag");
            _flagsMap["Read"]     = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "GreenFlag");
            _flagsMap["Forward"]  = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "BlueFlag");
            _flagsMap["Complete"] = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "CompletedFlag");
            _flagsMap["Reply"]    = Core.ResourceStore.FindUniqueResource("Flag", "FlagId", "BlueFlag");
        }