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 TextToAudioProfileConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, string language) | |
{ | |
AudioType audioType = (AudioType)value; | |
switch (audioType) | |
{ | |
case AudioType.Mp3: | |
return "MP3"; | |
case AudioType.M4a: |
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 abstract class ViewModelBase : Screen | |
{ | |
private readonly INavigationService _navigationService; | |
protected ViewModelBase(INavigationService navigationService) | |
{ | |
_navigationService = navigationService; | |
} | |
public void GoBack() |
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
#region ShareContract | |
protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e) | |
{ | |
base.OnNavigatedFrom(e); | |
UnregisterForShare(); | |
} | |
protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs 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
namespace BudgetPlanner.WP8 | |
{ | |
using System.Diagnostics; | |
using Microsoft.Phone.Shell; | |
using Microsoft.Phone.Controls; | |
public partial class App | |
{ | |
public static PhoneApplicationFrame RootFrame { 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
<Application | |
x:Class="BudgetPlanner.WP8.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:wp8="clr-namespace:BudgetPlanner.WP8"> | |
<Application.Resources> | |
<local:LocalizedStrings xmlns:local="clr-namespace:BudgetPlanner.WP8" x:Key="LocalizedStrings"/> | |
<wp8:AppBootstrapper x:Key="Bootstrapper"></wp8:AppBootstrapper> | |
</Application.Resources> |
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
namespace BudgetPlanner.WP8.ViewModels | |
{ | |
public class MainViewModel | |
{ | |
public MainViewModel() | |
{ | |
PageName = "It worked!"; | |
} | |
public string PageName { get; 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
#!/bin/sh | |
#read https://gist.github.com/thewindev/feb728495b31eda499230c1fda04addd for instructions | |
excluded_branches="develop master" #the branches where you don't want commit message validation | |
project_name="MyAwesomeProject" #the name of the project in JIRA | |
current_branch="$(git rev-parse --abbrev-ref HEAD)" | |
for e in $excluded_branches | |
do [[ "$e" == "$current_branch" ]] && exit 0; done #if you're on an excluded branch then we don't check the message | |
commit_regex='(project-[0-9])' |
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
using System.Collections.Immutable; | |
using System.Linq; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.Diagnostics; | |
namespace MembersSort | |
{ | |
[DiagnosticAnalyzer(LanguageNames.CSharp)] | |
public class MembersSortAnalyzer : DiagnosticAnalyzer | |
{ |
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
private static void AnalyzeSymbol(SymbolAnalysisContext context) | |
{ | |
var classSymbol = context.Symbol as INamedTypeSymbol; | |
if (classSymbol?.TypeKind != TypeKind.Class) | |
return; //we only need classes, not other types like enum, struct, etc. | |
var members = GetMembersFromClass(classSymbol); //retrieve only methods and properties | |
var unorderedMember = GetUnorderedMember(members); //then find the first member that is out of order | |
if (unorderedMember != null) | |
{ | |
var rule = new DiagnosticDescriptor(DiagnosticId, Title, $"Move {unorderedMember.Name} lower in the file", Category, |
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
using System.Collections.Generic; | |
using System.Collections.Immutable; | |
using System.Linq; | |
using System.Net.Http.Headers; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.Diagnostics; | |
namespace MembersSort | |
{ | |
[DiagnosticAnalyzer(LanguageNames.CSharp)] |
OlderNewer