Skip to content

Instantly share code, notes, and snippets.

View NavHelper.cs
public static class NavHelper
{
public static Page CurrentPage => Application.Current.MainPage;
private static INavigation Navigation => CurrentPage.Navigation;
public static async Task PopAsync()
{
var masterDetailPage = CurrentPage as MasterDetailPage;
View GroupedCheckboxSelectColumn.js
(function ($) {
// register namespace
$.extend(true, window, {
"Slick": {
"GroupedCheckboxSelectColumn": GroupedCheckboxSelectColumn
}
});
function GroupedCheckboxSelectColumn(options) {
View slick.checkboxselectionmodel.js
(function ($) {
// register namespace
$.extend(true, window, {
"Slick": {
"CheckboxSelectionModel": CheckboxSelectionModel
}
});
function CheckboxSelectionModel(options) {
var _ranges = [];
View AndroidExternalStorageWriter.cs
public class AndroidExternalStorageWriter : IAndroidExternalStorageWriter
{
public string CreateFile(string filename, byte[] bytes)
{
if (!Directory.Exists(Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "AccountMate")))
Directory.CreateDirectory(Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "AccountMate"));
var path = Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, "AccountMate", filename);
File.WriteAllBytes(path, bytes);
@julesx
julesx / AndroidDocumentViewer.cs
Last active Oct 4, 2018
Xamarin Forms file opener
View AndroidDocumentViewer.cs
using Android.Content;
using Mobile.Core.Droid.NativeImplementations;
using Mobile.Core.Interfaces;
using Xamarin.Forms;
[assembly: Xamarin.Forms.Dependency(typeof(DocumentViewer))]
namespace Mobile.Core.Droid.NativeImplementations
{
public class DocumentViewer : IDocumentViewer
{
View executecommand.cs
public static void ExecuteCommand(String checkOutFile)
{
int ExitCode;
ProcessStartInfo ProcessInfo;
Process process;
ProcessInfo = new ProcessStartInfo(checkOutFile);
ProcessInfo.CreateNoWindow = true;
ProcessInfo.UseShellExecute = false;
ProcessInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(checkOutFile);
@julesx
julesx / program.cs
Created Jun 21, 2018
command line work
View program.cs
private static void RunSelectedTests(List<String> apexClasses)
{
using (var cmdProcess = InitCmdProcess())
{
using (StreamWriter cmdProcessWriter = cmdProcess.StandardInput)
{
var selectedTests = string.Join(",", apexClasses);
cmdProcessWriter.WriteLine("sfdx force:apex:test:run -n " + selectedTests);// + " -d \"c:\\my stuff\\logs\"");
}
@julesx
julesx / program.cs
Created Jun 21, 2018
command line work
View program.cs
private static void RunSelectedTests(List<String> apexClasses)
{
using (var cmdProcess = InitCmdProcess())
{
using (StreamWriter cmdProcessWriter = cmdProcess.StandardInput)
{
var selectedTests = string.Join(",", apexClasses);
cmdProcessWriter.WriteLine("sfdx force:apex:test:run -n " + selectedTests);// + " -d \"c:\\my stuff\\logs\"");
}
View ImageCheckBox.xaml
<CheckBox x:Class="WpfApp1.ImageCheckBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp1"
Name="RootCheckBox"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<CheckBox.Template>
View VisualElementLostFocusBehavior.cs
public class VisualElementLostFocusBehavior : Behavior<VisualElement>
{
public static readonly BindableProperty CommandProperty =
BindableProperty.Create("Command", typeof(ICommand), typeof(VisualElementLostFocusBehavior));
public ICommand Command
{
get { return (ICommand)GetValue(CommandProperty); }
set { SetValue(CommandProperty, value); }
}
You can’t perform that action at this time.