/// <summary> /// Adds a saved search to your twitter account /// </summary> /// <param name="id">ID of saved search</param> /// <param name="callback">Async Callback used in Silverlight queries</param> /// <returns>SavedSearch object</returns> public async Task <SavedSearch> DestroySavedSearchAsync(ulong id, CancellationToken cancelToken = default(CancellationToken)) { if (id == 0) { throw new ArgumentException("Invalid Saved Search ID: " + id, "id"); } var savedSearchUrl = BaseUrl + "saved_searches/destroy/" + id + ".json"; var reqProc = new SavedSearchRequestProcessor <SavedSearch>(); RawResult = await TwitterExecutor.PostToTwitterAsync <SavedSearch>( savedSearchUrl, new Dictionary <string, string>(), cancelToken) .ConfigureAwait(false); SavedSearch result = reqProc.ProcessActionResult(RawResult, SavedSearchAction.Destroy); result.ID = id; return(result); }
public void SavedSearch_Can_Serialize() { var saveSrch = new SavedSearch(); var stringBuilder = new StringBuilder(); var writer = XmlWriter.Create(stringBuilder); var xmlSerializer = new XmlSerializer(typeof(SavedSearch)); xmlSerializer.Serialize(writer, saveSrch); }