/////////////////////////////////////////////////////////////////////// /// <summary>Creates a new feed</summary> /// <param name="uriBase">a uri, usually coming from /// <see cref="GBaseUriFactory"/></param> /// <param name="service">the GBaseService that this feed will be /// used with.</param> /////////////////////////////////////////////////////////////////////// public GBaseFeed(Uri uriBase, GBaseService service) : base(uriBase, service) { attributes = new GBaseAttributes(ExtensionElements); GBaseParse parse = new GBaseParse(); this.NewAtomEntry += parse.FeedParserEventHandler; this.NewExtensionElement += parse.ExtensionElementEventHandler; }
/////////////////////////////////////////////////////////////////////// /// <summary>Creates a new service object.</summary> /// <param name="applicationName">the name of your application, usually /// in the format: /// <c>CompanyOrAuthorName-ApplicationName-ApplicationVersion</c>. /// This name will be sent when logging in, in the UserAgent /// header. It will also be used to set the tag g:application /// of entries inserted and updated by this feed.</param> /// <param name="developerKey">a key you got from /// http://code.google.com/apis/base/signup.html</param> /////////////////////////////////////////////////////////////////////// public GBaseService(string applicationName, string developerKey) : base(GBaseServiceName, applicationName) { if (developerKey == null) { throw new ArgumentNullException("developerKey"); } this.applicationName = applicationName; this.devKey = developerKey; GBaseParse parse = new GBaseParse(); this.NewAtomEntry += parse.FeedParserEventHandler; this.NewExtensionElement += parse.ExtensionElementEventHandler; // setup headers for the devkey OnRequestFactoryChanged(); }