/// <summary> /// Set My Base to values of [data] /// </summary> /// <param name="data">as RSS channel</param> /// <returns></returns> private bool SetBase(Channel data) { try { ChannelID = data.ChannelID; RSSID = data.RSSID; Code = data.Code; Title = data.Title; Link = data.Link; Feed = data.Feed; Icon = data.Icon; Description = data.Description; Language = data.Language; return true; } catch (Exception ex) { GetLastError = ex; throw ex; } }
public Channel NewChannel(string title, string url) { XmlNode node = doc.CreateElement ("channel"); Channel c; rss.AppendChild (node); c = new Channel (doc, node); return c; }
/// <summary> /// Return Serialized String version of [data] Object /// </summary> /// <param name="data">as Channel</param> /// <returns></returns> /// <remarks></remarks> private static string XMLSerializeToString(Channel data) { try { XmlSerializer xmlSer = new XmlSerializer(typeof(Channel)); MemoryStream ms = new MemoryStream(); StreamReader strReader = default(StreamReader); string output = null; xmlSer.Serialize(ms, data); ms.Position = 0; strReader = new StreamReader(ms); output = strReader.ReadToEnd(); return output; } catch (Exception ex) { GetLastError = ex; return null; } }