secretlifeof.net
Quick Tips Archives — Secret Life of .NET
https://www.secretlifeof.net/category/quick-tips
Secret Life of .NET. Or, things I didn't know before now. Browsing category archives: Quick Tips. Dynamically get android resource ID from a string…. June 19, 2015. Sometimes, you need to get a particular resource ID from a string. I found myself needing this recently in order to get an icon from an Android resource dynamically. Here’s how you can do it! Var id = this.Context.Resources.GetIdentifier("abc ic search api mtrl alpha", "drawable", this.Context.PackageName);. Abc ic search api mtrl alpha".
secretlifeof.net
Bitmap Archives — Secret Life of .NET
https://www.secretlifeof.net/tag/bitmap
Secret Life of .NET. Or, things I didn't know before now. Browsing tag archives: Bitmap. Fun with ASCII images…. October 31, 2014. Convert any image into ASCII art! To be honest, this is not original code and was found on the internet. However, the code lost the attribution so if anyone knows where this comes from, please comment so we can fix the attribution. Continue reading →. View secretlifeof.net’s profile on Facebook. Shush (ssh) your package! I chose to use a language I hate. Yeah, no. Develop...
secretlifeof.net
Development Archives — Secret Life of .NET
https://www.secretlifeof.net/category/development
Secret Life of .NET. Or, things I didn't know before now. Browsing category archives: Development. Use AppCompat v7 with Xamarin.Forms. June 20, 2015. If you aren’t familiar with Google’s AppCompat library, you should read up on it here. And you can get some Lollipop features as described here. However, you don’t get access to the Toolbar. And many other theme-related niceties. The main problem with Xamarin.Forms is that your activity has to derive from the FormsApplicationActivity. To get more informati...
secretlifeof.net
FxCop Archives — Secret Life of .NET
https://www.secretlifeof.net/tag/fxcop
Secret Life of .NET. Or, things I didn't know before now. Browsing tag archives: FxCop. Fix common IDisposable code analysis issues…. October 29, 2014. Continue reading →. Unit test FxCop assemblies…. October 27, 2014. Unit testing custom FxCop assemblies is not the easiest thing in the world, but it can be! Using a unit testing framework like XUnit, you can write the following code to create a test fixture that allows you to parse an FxCop run. Stay tuned for a more extensive blog on this topic. Yeah, n...
secretlifeof.net
Mobile Archives — Secret Life of .NET
https://www.secretlifeof.net/category/development/mobile
Secret Life of .NET. Or, things I didn't know before now. Browsing category archives: Mobile. Use AppCompat v7 with Xamarin.Forms. June 20, 2015. If you aren’t familiar with Google’s AppCompat library, you should read up on it here. And you can get some Lollipop features as described here. However, you don’t get access to the Toolbar. And many other theme-related niceties. The main problem with Xamarin.Forms is that your activity has to derive from the FormsApplicationActivity. To get more information on...
secretlifeof.net
Free Advertising Archives — Secret Life of .NET
https://www.secretlifeof.net/tag/free-advertising
Secret Life of .NET. Or, things I didn't know before now. Browsing tag archives: Free Advertising. Use LINQPad to examine MSIL/IL…. November 4, 2014. Continue reading →. Work smarter with user-facing strings…. October 21, 2014. This amazing project helps you work with strings easily. View secretlifeof.net’s profile on Facebook. Shush (ssh) your package! I chose to use a language I hate. Developers are Plug and Play. Yeah, no. Developers are not plug and play. And I’m not talking about skill-set, ...When ...
secretlifeof.net
Set capacity of lists
https://www.secretlifeof.net/quick-tips/set-capacity-of-list-before-using
Secret Life of .NET. Or, things I didn't know before now. Set capacity of List before using…. November 3, 2014. You should attempt to always set the capacity of a List. Avoid var list = new List string (); foreach (var item in someLargeList) { list.Add(item); } / Corrected var list = new List string (someLargeList.Length); foreach (var item in someLargeList) { list.Add(item); }. Click to email this to a friend (Opens in new window). Click to print (Opens in new window). Shush (ssh) your package! I hate P...
secretlifeof.net
Dynamically get android resource ID from a string... — Secret Life of .NET
https://www.secretlifeof.net/development/dynamically-get-android-resource-id-from-a-string
Secret Life of .NET. Or, things I didn't know before now. Dynamically get android resource ID from a string…. June 19, 2015. Sometimes, you need to get a particular resource ID from a string. I found myself needing this recently in order to get an icon from an Android resource dynamically. Here’s how you can do it! Var id = this.Context.Resources.GetIdentifier("abc ic search api mtrl alpha", "drawable", this.Context.PackageName);. Abc ic search api mtrl alpha". Click to print (Opens in new window). I hat...
secretlifeof.net
Use AppCompat v7 with Xamarin.Forms — Secret Life of .NET
https://www.secretlifeof.net/development/use-appcompat-v7-with-xamarin-forms
Secret Life of .NET. Or, things I didn't know before now. Use AppCompat v7 with Xamarin.Forms. June 20, 2015. If you aren’t familiar with Google’s AppCompat library, you should read up on it here. And you can get some Lollipop features as described here. However, you don’t get access to the Toolbar. And many other theme-related niceties. The main problem with Xamarin.Forms is that your activity has to derive from the FormsApplicationActivity. Deprecated) or the AppCompatActivity. To get more information ...
secretlifeof.net
Prefer Lazy when you need singletons... — Secret Life of .NET
https://www.secretlifeof.net/quick-tips/prefer-lazy-need-singletons
Secret Life of .NET. Or, things I didn't know before now. When you need singletons…. November 5, 2014. Writing singletons is fairly straight-forward, but it’s easy to get wrong with the amount of code you have to write. .NET 4.0 introduced the Lazy. Type that lets you get it right more often. Creating one takes a lambda that is then called once and whose Value property is then used as the instance. Click to email this to a friend (Opens in new window). Click to print (Opens in new window). You must log in.