public ImportLinksCommand(ObjectRepository repository, OpmlItemCollection links, int catID) : this() { _linksToImport = links; _categoryID = catID; Repository = repository; }
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(); } }
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); }
public OpmlItem() { _childItems = new OpmlItemCollection(); }
public ImportLinksCommand(OpmlItemCollection links, int catID) : this() { _linksToImport = links; _categoryID = catID; }
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; }