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
Install LiveSharp extension: https://marketplace.visualstudio.com/items?itemName=ionoy.LiveSharp | |
Install LiveSharp NuGet package: https://www.nuget.org/packages/livesharp | |
1) add [assembly:LiveSharpInjectRuleBaseClass("Xamarin.Forms.ContentPage", "Xamarin.Forms.ContentView")] attribute to App.xaml.cs | |
2) add [LiveSharpStart] attribute to App constructor | |
3) add this code to the end of App constructor | |
LiveSharpContext.AddUpdateHandler(ctx => { | |
var instances = ctx.UpdatedMethods | |
.SelectMany(method => method.Instances) | |
.Distinct() |
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 Clarity; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xamarin.Forms; | |
namespace Sample.Calculator | |
{ | |
using CalcOp = Func<double, double, double>; |
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
class MyView : View, IElementController | |
{ | |
public static BindableProperty HostedPageProperty = BindableProperty.Create("HostedPage", typeof(Page), typeof(MyView), propertyChanged: OnHostedPageChanged); | |
ReadOnlyCollection<Element> _logicalChildrenInner = new ReadOnlyCollection<Element>(new List<Element>()); | |
ReadOnlyCollection<Element> IElementController.LogicalChildren => _logicalChildrenInner; | |
public void SetHostedPage(Page page) | |
{ | |
_logicalChildrenInner = new ReadOnlyCollection<Element>(new List<Element>(new[] { page } )); |
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 Clarity; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xamarin.Forms; | |
namespace Sample.Calculator | |
{ | |
public class App : Application { | |
public App() => MainPage = new Calculator().MainPage(); |
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 CodedUiTest : ContentView | |
{ | |
public CodedUiTest () | |
{ | |
InitializeContentLive(); | |
} | |
public void InitializeContentLive() | |
{ | |
var grid = new Grid(); |
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
// Attribute can be omitted if method name is exactly `InitializeContent` | |
[ContentInitializer] | |
public void InitializeContent() { | |
Content = new Grid { | |
... | |
}; | |
} |
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
[Export(typeof(IQuickInfoSourceProvider))] | |
[Name("Mouse processor")] | |
[ContentType(Strings.AmmyContentType)] | |
[TextViewRole(PredefinedTextViewRoles.Interactive)] | |
internal sealed class QuickInfoSourceProvider : IQuickInfoSourceProvider | |
{ | |
[Import] | |
SVsServiceProvider serviceProvider; | |
public IQuickInfoSource TryCreateQuickInfoSource(ITextBuffer textBuffer) |
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
Syntax: | |
extend syntax Expression | |
{ | |
... | |
| Parenthesized = "(" Expression ")"; | |
... | |
} | |
Mapping: |
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
[ExplicitSpaces] | |
syntax Binding = "bind" s Path=BindingPath? Source=("from" s BindingSource)? Converter=("convert" s LambdaExpr s)? ConverterBack=("convertback" s LambdaExpr s)? Settings=("set" s "[" s (!"set" NodeMember; ContentDelimiter)* s "]")?; | |
syntax BindingPath | |
{ | |
| StringLiteral | |
| Parameter = "$" Key=Reference | |
| QRef = Key=QualifiedReference | |
} | |
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
[CompileStatistic("RegularRuleParser")] | |
public static int _#_NotEscs_(int pos, string text) | |
{ | |
int okPos = -1; | |
if (pos < text.Length) | |
{ | |
int curPos = pos + 1; | |
while (true) | |
{ | |
okPos = curPos; |
NewerOlder