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
var webView = new WebView("http://www.whatismybrowser.com", new BrowserSettings()); | |
panel.invokeOnThread( | |
()=>{ | |
try | |
{ | |
webView.Dock = DockStyle.Fill; | |
panel.clear().Controls.Add(webView); | |
} | |
catch(Exception ex) |
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
dynamic expando = new ExpandoObject(); | |
expando.Name = "John"; | |
expando.Speak = new Func<string>(()=> { return "Hi " + expando.Name;}); | |
return expando.Speak(); | |
//using System.Dynamic; | |
//O2Ref:System.Core.dll | |
//O2Ref:Microsoft.CSharp.dll |
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
//var webView = new WebView("http://www.whatismybrowser.com", new BrowserSettings()); | |
var topPanel = panel.clear().add_Panel(); | |
var autoResetEvent = new AutoResetEvent(false); | |
var webView = (WebView)topPanel.invokeOnThread( | |
()=>{ | |
//var _webView = new WebView("http://about:blank", new BrowserSettings()); | |
var elementHost = topPanel.add_WPF_Host(); | |
var zoom = elementHost.add_Zoom(); | |
var _webView = zoom.set<WebView>(); |
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
//return "Util - DiagramDesigner Editor.h2".local().startProcess(); | |
var process = "O2 Xaml Editor (PoC).h2".local().startProcess(); | |
this.sleep(2000); | |
var hwnd = process.MainWindowHandle; | |
if (hwnd == IntPtr.Zero) | |
return "Could not get MainWindow handle"; | |
"Got main Window Handle: {0}".info(hwnd); | |
var snoopAssembly = @"Snoop\Snoop.exe".assembly(); |
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
//var topPanel = panel.clear().add_Panel(); | |
var topPanel = "Simple AstTester".popupWindow(700,300); | |
var codeViewer = topPanel.title("Code").add_SourceCodeViewer(); | |
var errorsList = topPanel.insert_Right(300,"AstTree Errors").add_TextArea(); | |
Action<string> showErrors = | |
(newCode)=>{ | |
codeViewer.editor().clearBookmarksAndMarkers(); | |
var astTree = newCode.tree(); | |
var errors = astTree.errors(); | |
foreach(var error in errors) |
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
panel.clear().add_ConsoleOut(); | |
var code = @" | |
using System; | |
class Greeter | |
{ | |
static string Greet() | |
{ | |
Console.WriteLine(""Hello, World""); | |
return ""hello from here""; | |
} |
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
panel.clear().add_ConsoleOut(); | |
var code = @" | |
using System; | |
class Greeter | |
{ | |
static string Greet() | |
{ | |
Console.WriteLine(""Hello, World!!!""); | |
return ""Another hello""; | |
} |
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
return @"using System; class Greeter { static string Greet() { return ""Another hello!!""; }}" | |
.tree().compiler("Great").create_Assembly().type("Greeter").invokeStatic("Greet"); | |
//O2Ref:O2_FluentSharp_Roslyn.dll |
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
var code = @" | |
class C | |
{ | |
}"; | |
// Get ClassDeclarationSyntax corresponding to 'class C' above. | |
var classDeclaration = code.astTree() | |
.compilationUnit() | |
.classes().first(); |
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
var tree = SyntaxTree.ParseCompilationUnit(@" | |
class C | |
{ | |
}"); | |
var compilationUnit = (CompilationUnitSyntax)tree.GetRoot(); | |
// Get ClassDeclarationSyntax corresponding to 'class C' above. | |
ClassDeclarationSyntax classDeclaration = compilationUnit.ChildNodes() | |
.OfType<ClassDeclarationSyntax>().Single(); |