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
# FTP details | |
$ftpServer = '' | |
$ftpUsername = '' | |
$ftpPassword = '' | |
# local paths | |
$perlPath = 'C:\Perl\bin\perl.exe' | |
$awstatsPath = 'C:\WWW\Internal\awstats-7.3\wwwroot\cgi-bin\awstats.pl' | |
$downloadDir = 'C:\WWW\_Logs\Azure' |
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
function Set-WinStoreSetting { | |
param ( | |
[Parameter(Mandatory=$true, Position=0)][string]$PackageName, | |
[Parameter(Mandatory=$true, Position=1)][string]$SettingName, | |
[Parameter(Mandatory=$true, Position=2)][string]$SettingValue | |
) | |
$settingsFile = [IO.Path]::Combine($env:LOCALAPPDATA, 'Packages', $PackageName, 'Settings\settings.dat') | |
# temporary paths |
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 Task<string> DownloadStringAsync(Uri uri) | |
{ | |
var taskSource = new TaskCompletionSource<string>(); | |
var webClient = new WebClient(); | |
webClient.DownloadStringCompleted += (sender, args) => | |
{ | |
try | |
{ | |
if (args.Error != 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
private async Task<byte[]> ReadAsync(string filename) | |
{ | |
var fileInfo = new FileInfo(filename); | |
using (var stream = new FileStream(filename, FileMode.Open)) | |
{ | |
var buffer = new byte[fileInfo.Length]; | |
await Task<int>.Factory.FromAsync(stream.BeginRead, stream.EndRead, buffer, 0, buffer.Length, null); | |
return buffer; | |
} | |
} |
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 EnumToImageConverter : IValueConverter | |
{ | |
public string SubFolder { get; set; } | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
if (value is Enum && targetType == typeof(ImageSource)) | |
{ | |
var enumType = value.GetType(); | |
var format = String.IsNullOrEmpty(SubFolder) ? "/Assets/{0}/{2}.png" : "/Assets/{0}/{1}/{2}.png"; |
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
<Grid Width="60" Height="60" | |
VerticalAlignment="Top" | |
Background="{StaticResource PhoneAccentBrush}"> | |
<Image Source="{Binding LogType, Converter={StaticResource EnumToImageConverter}}" /> | |
</Grid> |
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
<Page.Resources> | |
<b:NameScopeBinding x:Key="ListView" Source="{Binding ElementName=ListView}" /> | |
</Page.Resources> | |
<ListView x:Name="ListView" | |
SelectionMode="Single" | |
IsItemClickEnabled="True" | |
ItemsSource="{Binding Items}"> | |
<i:Interaction.Triggers> | |
<i:EventTrigger EventName="ItemClick"> |
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
<ListView IsItemClickEnabled="True" | |
ItemsSource="{Binding Items}"> | |
<i:Interaction.Triggers> | |
<i:EventTrigger EventName="ItemClick"> | |
<i:InvokeCommandAction Command="{Binding ItemClickedCommand}" /> | |
</i:EventTrigger> | |
</i:Interaction.Triggers> | |
</ListView> |
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
<ListView IsItemClickEnabled="True" | |
ItemsSource="{Binding Items}"> | |
<i:Interaction.Behaviors> | |
<local:ItemClickedBehavior ItemClickedCommand="{Binding ItemClickedCommand}" /> | |
</i:Interaction.Behaviors> | |
</ListView> |
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 static class AttachedProperties | |
{ | |
public static DependencyProperty ItemClickCommandProperty = | |
DependencyProperty.RegisterAttached("ItemClickCommand", | |
typeof(ICommand), | |
typeof(AttachedProperties), | |
new PropertyMetadata(null, OnItemClickCommandChanged)); | |
public static void SetItemClickCommand(DependencyObject target, ICommand value) | |
{ |
NewerOlder