public void Import(TOpmlDocument opmlDocument) { if (opmlDocument.Load()) { TConfigGroup ImportedGroup = new TConfigGroup(); ImportedGroup.Name = opmlDocument.Name; foreach (TOpmlOutline OutlineItem in opmlDocument.Outlines) { ImportedGroup.ImportOpmlOutline(OutlineItem, DataFolderPath); } RootGroup.Groups.Add(ImportedGroup); } Save(); if (ImportCompleted != null) { ImportCompleted(this, EventArgs.Empty); } }
public void ImportOpmlOutline(TOpmlOutline outline, string dataPath) { switch (outline.OutlineType) { case "rss": TLocalChannel NewChannel = new TLocalChannel(outline); NewChannel.StoragePath = dataPath; Channels.Add(NewChannel); break; case "group": TConfigGroup NewGroup = new TConfigGroup(); NewGroup.Name = outline.Title; if (outline.Outlines.Count > 0) { foreach (TOpmlOutline OutlineItem in outline.Outlines) { NewGroup.ImportOpmlOutline(OutlineItem, dataPath); } } Groups.Add(NewGroup); break; } }