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 class LocalizedStrings | |
{ | |
private static readonly Resources.AppResources localizedResources = new Resources.AppResources(); | |
public Resources.AppResources LocalizedResources { get { return localizedResources; } } | |
} |
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
let data = | |
"test.xlsx" | |
|> Excel.getWorksheetByIndex 1 | |
|> Excel.getContent | |
data | |
|> Seq.iter (fun x-> printfn "%s" x) |
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
[<DataServiceKey("PartitionKey", "RowKey")>] | |
type LogEntity() = | |
let mutable partitionKey = "" | |
let mutable rowKey = "" | |
let mutable message = "" | |
let mutable timestamp = DateTime.Now | |
let mutable severity = "" | |
member x.PartitionKey with get() = partitionKey and set v = partitionKey <- v | |
member x.RowKey with get() = rowKey and set v = rowKey <- v | |
member x.Message with get() = message and set v = message <- v |
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
type Severity = | |
| Debug | |
| Information | |
| Error | |
with | |
member this.toString() = | |
match this with | |
| Debug -> "Debug" | |
| Information -> "Information" | |
| Error -> "Error" |
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
[<CLIMutable>] | |
[<DataServiceKey("PartitionKey", "RowKey")>] | |
type LogEntity = | |
{ | |
Message: string | |
Timestamp: DateTime | |
Severity: string | |
PartitionKey: string | |
RowKey: string | |
} |
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
let getLogs (date:DateTime) = seq { | |
for e in client.GetDataServiceContext().CreateQuery<LogEntity>("LogEntity") do | |
if e.PartitionKey = date.ToString("yyyy-MM-dd") then | |
yield e | |
} |
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
let log (severity:Severity) message = | |
async { | |
let entry = LogEntity(PartitionKey = DateTime.Now.ToString("yyyy-MM-dd"), RowKey = Guid.NewGuid().ToString(), Timestamp = DateTime.Now, Message = message, Severity = severity.ToString()) | |
CreateEntityWithClient client "LogEntity" entry | |
} |> Async.Start |
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
let log (severity:Severity) message = | |
let entry = LogEntity(PartitionKey = DateTime.Now.ToString("yyyy-MM-dd"), RowKey = Guid.NewGuid().ToString(), Timestamp = DateTime.Now, Message = message, Severity = string severity) | |
CreateEntityWithClient client "LogEntity" entry |
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
let client = BuildTableClientWithConnStr "TableStorageConnectionString" |
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
protected override void OnInvoke(ScheduledTask task) | |
{ | |
ScheduledActionService.LaunchForTest(task.Name, TimeSpan.FromSeconds(60)); | |
var toast = new ShellToast {Title = DateTime.Now.ToShortTimeString(), Content = "Task Running"}; | |
toast.Show(); | |
NotifyComplete(); | |
} |
OlderNewer