-2

I am creating a cross-platform application with Awesomium using Mono(C#). I am trying to create app with HTML/CSS/JS UI, so on main form only one item - Awesomium WebView. But I am new at this thus I know nothing about logic and structure of the applications with HTML/CSS/JS GUI.

My application not will be absolutely standalone, it will be connect to the server and receive data from it, but I want UI which will be on the client side and which will not be loaded from a server every time.

So I need sample application which uses Awesomium or another similar SDK for the standalone GUI, not like web-browser.

Or I need detailed explanation about logic and structure of the application with HTML UI(for example how I need to store my html/css/js files? Like the regular html/css/js files? Is it safely? etc).

Thanks!

konstantin_doncov
  • 2,725
  • 4
  • 40
  • 100

1 Answers1

1

You can use the ResourceInteceptor to load HTML,CSS and JavaScript files that are either local files (content) or embedded resources. I do prefer embedded resources as there are no files are laying around that can be manipulating resulting in a corrupted application.

When it comes to project structure I do not have seen some sort of 'best-practice' yet. From my experience it's feasible to create a 'html', 'css' and 'js' folder to store your resources. I also often put this folder into a 'ServerResources' root folder (you can choose your own naming) so that I have a clear separation of C# and web things.

EDIT

Some links to answers with examples of how to use the ResourceInterceptor:

How to Implement ResourceInterceptor Awesomium 1.7.1

How to hide the cursor in Awesomium (Shows how you inject data. You can load the embedded resource as usual and inject it in this function)

And of course there is also the official documentation:

http://docs.awesomium.net/html/P_Awesomium_Core_WebCore_ResourceInterceptor.htm

The embedded resources are not visible as files but are rather part of the DLL.

Community
  • 1
  • 1
Sjoerd222888
  • 3,228
  • 3
  • 31
  • 64
  • Many thanks! Can you post small example of code which uses ResourceInteceptor and "assets"(embedded resources) for standalone app? Is it true that embedded resources not shown like folders and files in explorer but I can use It like embedded files(like assets in android)? Sorry for stupid explanation! :) – konstantin_doncov Feb 13 '15 at 21:13
  • I edited my answer. I gave some links that show usage of the ResourceInterceptor. If you have specif questions about the ResourceInterceptor of Awesomium it's maybe better to ask a seperate question. :-) – Sjoerd222888 Feb 15 '15 at 10:59
  • I can't approve your answer now because I have an issue with this. Please check http://stackoverflow.com/questions/28531345/use-embedded-resource-like-webcontrol-source-in-awesomium – konstantin_doncov Feb 15 '15 at 21:27
  • You request a resource with an URL, in the ResourceInterceptor you see which URL was requested, so you know which file to load... Your embedded resource can be referenced with it's namespace (e.g. Assembly.MaybeAFolder.MaybeAnotherFolder.File.FileEtension). Read about how to load embedded resources. – Sjoerd222888 Feb 16 '15 at 08:32
  • You can use the full Namespace of your embedded resource as URL (depending on your application, make sure you only to load from the correct assembly because you might create a security problem otherwise) – Sjoerd222888 Feb 16 '15 at 08:38