This file contains hidden or 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
| const string sql = "SELECT [layout_key], [layout_name] FROM [layout]"; | |
| var layouts = new MsSqlDataSource(_connectionString) | |
| .Execute(sql) | |
| .Select(row => | |
| new Layout( | |
| row.GetValueOrDefault<int>("layout_key"), | |
| row.GetValueOrDefault<string>("layout_name") | |
| ) | |
| ); |
This file contains hidden or 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
| /// <summary> | |
| /// An AsyncTask that will asynchronously download an image and assign it to an ImageView. | |
| /// </summary> | |
| public class BitmapDownloaderTask : AsyncTask<String, Java.Lang.Void, Bitmap> | |
| { | |
| private readonly ImageView _imageView; | |
| public BitmapDownloaderTask(ImageView imageView) | |
| { | |
| if (imageView == null) |
This file contains hidden or 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
| if (_memoryCache.Get(key) == null) | |
| _memoryCache.Put(key, bitmap); |
This file contains hidden or 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
| var secondsSinceReferenceDate = 386463600; // 2013-4-1 | |
| var referenceDate = new DateTime(2001, 1, 1); | |
| var databaseUtcTime = refdate.AddSeconds(secondsSinceReferenceDate); | |
| TimeZoneInfo timeZone; | |
| try { | |
| timeZone = TimeZoneInfo.FindSystemTimeZoneById("Europe/Dublin"); | |
| } | |
| catch (Exception) |
This file contains hidden or 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
| context.translate(0.5, 0.5); |
This file contains hidden or 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
| var id = 1; | |
| using (var db = new entityContext()) | |
| { | |
| // Select entity | |
| var entity = db.dbset.FirstOrDefault(e => e.ID == id); | |
| if (entity != null) | |
| { | |
| // Remove Entity | |
| db.dbset.Remove(entity); | |
| db.SaveChanges(); |
This file contains hidden or 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
| $.getScript('http://example.com/script1.js', function () { | |
| alert('Script Loaded'); | |
| }); |
This file contains hidden or 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
| var food = { | |
| fruit: [ | |
| { name: 'banana', value: 'joke fruit', type: 'fruit' }, | |
| { name: 'apple', value: 'newtonian legend', type: 'fruit' } | |
| ], | |
| vegetables: [ | |
| { name: 'cabbage', value: 'filth', type: 'vegetable' }, | |
| { name: 'broccoli', value: 'green evil', type: 'vegetable' } | |
| ] | |
| }; |
This file contains hidden or 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 class CustomAndroidEntryRenderer : EntryRenderer | |
| { | |
| protected override void OnElementChanged(ElementChangedEventArgs<Entry> e) | |
| { | |
| base.OnElementChanged(e); | |
| if (e.OldElement == null) { | |
| // Get the 'native' control | |
| var nativeTextField = (EditText)Control; | |
This file contains hidden or 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
| using Xamarin.Forms; | |
| namespace DraggableView | |
| { | |
| public class App | |
| { | |
| public static Page GetMainPage() | |
| { | |
| return new ContentPage | |
| { |
OlderNewer