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
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"baseUriName": { | |
"type": "string" | |
}, | |
"sqlServerName": { | |
"type": "string" | |
}, |
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
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"siteName": { "type": "string" }, | |
"siteLocation": { | |
"type": "string", | |
"defaultValue": "West Europe" | |
}, | |
"sqlServerName": { |
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
//the command: | |
private RelayCommand logInCommand; | |
public RelayCommand LogInCommand | |
{ | |
get | |
{ | |
return logInCommand ?? | |
(logInCommand = new RelayCommand( |
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
This example uses Storyboards and iPad app. We have few entities here the TreeViewController (also holding the TreeViewSource delegate and my TreeNode Class) and TreeViewCell where I’m adding UIViews programatically. | |
Code as follows: | |
1) TreeViewController class: | |
public partial class TvViewController : UIViewController | |
{ | |
public TvViewController(IntPtr handle) : base(handle) |
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
private void SavePhotoToAppDirectory(NSData data) | |
{ | |
var documentsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | |
var jpgFilename = System.IO.Path.Combine(documentsDirectory, | |
$"Photo{DateTime.Now.TimeOfDay.Milliseconds}.jpg"); | |
if (File.Exists(jpgFilename)) return; | |
NSError err = null; | |
if (!data.Save(jpgFilename, false, out err)) |
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
//MainActivity's private vars and key methods: | |
public class MainActivity : FragmentActivityBase | |
{ | |
private RecyclerView _recyclerViewPhotosTakenEdit; | |
private IList<PhotoItemModel> _photoItemsModel; | |
private RecyclerView.LayoutManager _layoutManager; | |
private PhotoQuestionRecyclerAdapter _photoQuestionImageAdapter; | |
...... | |
} | |
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
email regex: | |
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])? | |
usage: | |
bool isEmail = Regex.IsMatch(emailString, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase); |
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
//_mapFragment.Map is now obsolete with latest Google Play services.. new approach is needed... | |
private void SetUpMap() | |
{ | |
_mapFragment = FragmentManager.FindFragmentByTag("map") as MapFragment; | |
if (_mapFragment == null) | |
{ | |
GoogleMapOptions mapOptions = new GoogleMapOptions() | |
.InvokeMapType(GoogleMap.MapTypeHybrid) | |
.InvokeZoomControlsEnabled(true) | |
.InvokeCompassEnabled(true); |
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
//PhotoObserver.cs | |
public class Media | |
{ | |
public System.DateTime Added { get; set; } | |
public File File { get; set; } | |
public System.DateTime Modified { get; set; } | |
public string Type { get; set; } | |
public override string ToString() |
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
SELECT DISTINCT EHS.EmployeeID, MAX(CASE WHEN FromDate >= @DateFrom THEN FromDate ELSE @DateFrom END) AS Starts, | |
MAX(CASE WHEN ToDate <= @DateTo THEN ToDate ELSE @DateTo END) AS Ends, E.Salaried, ISNULL(E.Salary, 0) as Salary | |
FROM EmployeeHolidaySickness EHS | |
LEFT OUTER JOIN Employees E ON EHS.EmployeeID = E.EmployeeID | |
WHERE (RecordType = 'H') AND (FromDate <= @DateTo AND ToDate >= @DateFrom) | |
GROUP BY EHS.EmployeeID, E.Salaried, ISNULL(E.Salary, 0) |