C# and multicultural IsDate() and ToDate()

C# does not provide IsDate() function. Sometimes in your developer environment region settings are different from the live environment. In my case, I don’t know what region settings there are in my company servers. For this reason, I created a function to check is a string is a date in a culture and to convert a string to a date. /// /// Determines whether the specified text is date. /// /// The text. /// /// true if the specified text is date; /// otherwise, false. /// public static bool IsDate(this…

Read More

Device name in Xamarin

microsoft xamarin heros c# iOS Android UWP

Using Device Information Plugin for Xamarin and Windows, you have access to same information for a device: GenerateAppId: used to generate a unique Id for your app. Id: this is the device specific Id Device Model: get the model of the device Version: get the version of the Operating System If you want the device name, it’s not in this list. Then for that we can create our functions. IDevice interface First of all we have to create an interface, I call it IDevice. using System; namespace myApp.Interfaces { public…

Read More