This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string TimeAgo(this DateTime dateTime) | |
{ | |
string result = string.Empty; | |
var timeSpan = DateTime.Now.Subtract(dateTime);</code> | |
if (timeSpan <= TimeSpan.FromSeconds(60)) | |
{ | |
result = string.Format("{0} seconds ago", timeSpan.Seconds); | |
} | |
else if (timeSpan <= TimeSpan.FromMinutes(60)) { result = timeSpan.Minutes > 1 ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string urlPath = "http://www.tiu.com/test/register.php"; | |
var httpClient = new HttpClient(new HttpClientHandler()); | |
var values = new List<KeyValuePair<string, string>> | |
{ | |
new KeyValuePair<string, string>("name", name), | |
new KeyValuePair<string, string>("email", email), | |
new KeyValuePair<string, string>("password",password) | |
}; | |
HttpResponseMessage response = await httpClient.PostAsync(urlPath, new FormUrlEncodedContent(values)); | |
response.EnsureSuccessStatusCode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpClient http = new System.Net.Http.HttpClient(); | |
string response = await http.GetStringAsync("http://www.tokkri.com/windowsphone/webservices/checkLogin.php?emailID=" + email + "&password=" + password); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double CalculateDistance(double prevLat, double prevLong, double currLat, double currLong) | |
{ | |
const double degreesToRadians = (Math.PI / 180.0); | |
const double earthRadius = 6371; // kilometers | |
// convert latitude and longitude values to radians | |
var prevRadLat = prevLat * degreesToRadians; | |
var prevRadLong = prevLong * degreesToRadians; | |
var currRadLat = currLat * degreesToRadians; | |
var currRadLong = currLong * degreesToRadians; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MessageBoxResult res = MessageBox.Show("Ringtone Saved. Please take a moment to rate our app.It motivates us to make the list better.", "Free Ringtones", MessageBoxButton.OKCancel); | |
if (res == MessageBoxResult.OK) | |
{ | |
MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask(); | |
marketplaceReviewTask.Show(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta property="al:android:url" content="https://play.google.com/store/apps/details?id=com.maplegraph.tokkri.core" /> | |
<meta property="al:android:app_name" content="Tokkri" /> | |
<meta property="al:android:package" content="com.maplegraph.tokkri.core" /> | |
<meta property="al:windows_phone:url" content="www.windowsphone.com/en-in/store/app/tokkri/c2b4e3bb-5005-47f4-837b-1a9ecb7d5619" /> | |
<meta property="al:windows_phone:app_name" content="Tokkri" /> | |
<meta property="al:windows_phone:app_id" content="c2b4e3bb-5005-47f4-837b-1a9ecb7d5619" /> | |
<meta property="al:web:url" content="http://www.tokkri.com" /> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Stream GenerateStreamFromString(string s) | |
{ | |
MemoryStream stream = new MemoryStream(); | |
StreamWriter writer = new StreamWriter(stream); | |
writer.Write(s); | |
writer.Flush(); | |
stream.Position = 0; | |
return stream; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Button_Click(object sender, RoutedEventArgs e) | |
{ | |
GoogleAnalytics.EasyTracker.GetTracker().SendEvent("Button", "Click", null, 0); | |
try | |
{ | |
//do something | |
} | |
catch (NotImplementedException exc) | |
{ | |
GoogleAnalytics.EasyTracker.GetTracker().SendException(exc.Message, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ObservableCollection<ProductItem> picItems = new ObservableCollection<ProductItem>(); | |
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) | |
{ | |
RenderStoreItems(); | |
base.OnNavigatedTo(e); | |
} | |
private async void RenderStoreItems() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void ButtonBuyNow_Clicked(object sender, RoutedEventArgs e) | |
{ | |
Button btn = sender as Button; | |
string key = btn.Tag.ToString(); | |
if (!Store.CurrentApp.LicenseInformation.ProductLicenses[key].IsActive) | |
{ | |
ListingInformation li = await Store.CurrentApp.LoadListingInformationAsync(); | |
string pID = li.ProductListings[key].ProductId; |