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
/BufferHeight 1000 powershell |
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
$aliasesPath = Join-Path -Path ([System.IO.Path]::GetDirectoryName($PROFILE)) -ChildPath "alias.txt" | |
function Export-AliasWithEXEInPATH | |
{ | |
$aliasDict = @{} | |
$existingAlias = Get-Alias | ForEach-Object {$_.Name} | |
foreach($aliasName in $existingAlias) | |
{ | |
$aliasDict.Add($aliasName,"") | |
} |
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
//builds the union range form the indices | |
private static Range Union(IEnumerable<int> rows) | |
{ | |
Range range = null; | |
foreach (int row in rows) | |
{ | |
var currentLine = ExcelAddIn.ActiveSheet.Range["A" + row + ":" + "C" + row]; | |
range = range == null ? currentLine : ExcelAddIn.Application.Union(range, currentLine); | |
} | |
return range; |
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
$devcon = "C:\Program Files (x86)\Windows Kits\8.1\Tools\x64\devcon.exe" | |
$audioID = "@HDAUDIO\FUNC_01&VEN_8086&DEV_2807&SUBSYS_80860101&REV_1000\4&36161A1D&0&0001" | |
$displayID = "@PCI\VEN_8086&DEV_0A16&SUBSYS_130D1043&REV_09\3&11583659&0&10" | |
. $devcon enable $audioID | |
. $devcon enable $displayID | |
. $devcon restart $audioID | |
. $devcon restart $displayId | |
Read-Host |
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 interface IFootballClub | |
{ | |
string FullName { get; } | |
string NickName { get; } | |
int CreationYear { get; } | |
} |
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 interface IChampionship | |
{ | |
List<IFootballClub> CurrentChampionShipRanking { get; } | |
List<IFootballClub> UserBet { get; set; } | |
int GetGoodBetCount(); | |
} |
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 interface IChampionshipBetViewModel : IDropTarget | |
{ | |
ObservableCollection<IFootballClub> FootballClubs { get; } | |
ICommand ClickSave { get; } | |
} |
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
<UserControl x:Class="MvvMSample.Views.ChampionshipBetView" ... > | |
<UserControl.Resources> | |
<!-- go to github.com/bpatra/MvvMSample for complete implementation--> | |
</UserControl.Resources> | |
<UserControl.DataContext> | |
<Binding Path="ChampionshipBetViewModel" Source="{StaticResource Locator}" /> | |
</UserControl.DataContext> | |
<StackPanel> | |
<ListView ItemsSource="{Binding FootballClubs}" | |
dd:DragDrop.IsDragSource="True" |
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 ChampionshipBetViewModel : IChampionshipBetViewModel, IDropTarget | |
{ | |
private readonly IChampionship _championship; | |
public ChampionshipBetViewModel(IChampionship championship) | |
{ | |
_championship = championship; | |
FootballClubs = new ObservableCollection<IFootballClub>(championship.UserBet); | |
} | |
public ObservableCollection<IFootballClub> FootballClubs { get; private set; } |
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
[TestClass] | |
public class ChampionshipBetViewModel_DragAndDrop_Tests | |
{ | |
private readonly ChampionshipBetViewModel _championshipBetViewModel; | |
private readonly Mock<IChampionship> _championShip; | |
private readonly IFootballClub _club1; | |
private readonly IFootballClub _club2; | |
private readonly IFootballClub _club3; | |
private readonly IFootballClub _club4; |