Пример #1
0
 public ImportLinksCommand(ObjectRepository repository, OpmlItemCollection links, int catID)
     : this()
 {
     _linksToImport = links;
     _categoryID    = catID;
     Repository     = repository;
 }
Пример #2
0
 public ImportLinksCommand(ObjectRepository repository, OpmlItemCollection links, int catID)
     : this()
 {
     _linksToImport = links;
     _categoryID = catID;
     Repository = repository;
 }
Пример #3
0
        private void ImportOpml()
        {
            if (OpmlImportFile.PostedFile.FileName.Trim().Length > 0)
            {
                OpmlItemCollection importedLinks = OpmlProvider.Import(OpmlImportFile.PostedFile.InputStream);

                if (importedLinks.Count > 0)
                {
                    var command = new ImportLinksCommand(Repository, importedLinks,
                                                         Int32.Parse(ddlImportExportCategories.SelectedItem.Value));
                    Messages.ShowMessage(command.Execute());
                }

                BindList();
            }
        }
Пример #4
0
        public static OpmlItemCollection Import(Stream fileStream)
        {
            var _currentBatch = new OpmlItemCollection();

            XmlReader      reader = new XmlTextReader(fileStream);
            var            doc    = new XPathDocument(reader);
            XPathNavigator nav    = doc.CreateNavigator();

            XPathNodeIterator outlineItems = nav.Select("/opml/body/outline");

            while (outlineItems.MoveNext())
            {
                _currentBatch.AddRange(DeserializeItem(outlineItems.Current));
            }

            return(_currentBatch);
        }
Пример #5
0
 public OpmlItem()
 {
     _childItems = new OpmlItemCollection();
 }
Пример #6
0
 public ImportLinksCommand(OpmlItemCollection links, int catID)
     : this()
 {
     _linksToImport = links;
     _categoryID = catID;
 }
Пример #7
0
 public ImportLinksCommand(OpmlItemCollection links, int catID)
     : this()
 {
     _linksToImport = links;
     _categoryID    = catID;
 }
Пример #8
0
 public OpmlItem()
 {
     _childItems = new OpmlItemCollection();
 }
Пример #9
0
        public static OpmlItemCollection Import(Stream fileStream)
        {
            var _currentBatch = new OpmlItemCollection();

            XmlReader reader = new XmlTextReader(fileStream);
            var doc = new XPathDocument(reader);
            XPathNavigator nav = doc.CreateNavigator();

            XPathNodeIterator outlineItems = nav.Select("/opml/body/outline");

            while (outlineItems.MoveNext())
            {
                _currentBatch.AddRange(DeserializeItem(outlineItems.Current));
            }

            return _currentBatch;
        }