Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the FootnoteView class
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="filterInstance">The tag that identifies the book filter instance.</param>
		/// <param name="app">The application.</param>
		/// <param name="viewName">The name of the view.</param>
		/// <param name="fEditable"><c>true</c> if view is to be editable.</param>
		/// <param name="viewType">Bit-flags indicating type of view.</param>
		/// <param name="btWs">The back translation writing system (if needed).</param>
		/// <param name="draftView">The corresponding draftview pane</param>
		/// ------------------------------------------------------------------------------------
		public FootnoteView(FdoCache cache, int filterInstance, IApp app, string viewName,
			bool fEditable, TeViewType viewType, int btWs, DraftView draftView) :
			base(cache, filterInstance, app, viewName, fEditable, viewType, btWs)
		{
			Debug.Assert((viewType & TeViewType.FootnoteView) != 0);
			m_draftView = draftView;
		}
		public void Initialize(FdoCache cache, IHelpTopicProvider helpTopicProvider,
			IApp app, IVwStylesheet stylesheet, NotebookImportWiz.CharMapping charMapping)
		{
			m_cache = cache;
			m_helpTopicProvider = helpTopicProvider;
			m_app = app;
			m_stylesheet = stylesheet;
			if (charMapping == null)
			{
				m_tbBeginMkr.Text = String.Empty;
				m_tbEndMkr.Text = String.Empty;
				m_rbEndOfWord.Checked = false;
				m_rbEndOfField.Checked = true;
				FillWritingSystemCombo(null);
				FillStylesCombo(null);
				m_chkIgnore.Checked = false;
			}
			else
			{
				m_tbBeginMkr.Text = charMapping.BeginMarker;
				m_tbEndMkr.Text = charMapping.EndMarker;
				m_rbEndOfWord.Checked = charMapping.EndWithWord;
				m_rbEndOfField.Checked = !charMapping.EndWithWord;
				FillWritingSystemCombo(charMapping.DestinationWritingSystemId);
				FillStylesCombo(charMapping.DestinationStyle);
				m_chkIgnore.Checked = charMapping.IgnoreMarkerOnImport;
			}
		}
Example #3
0
        public virtual void BeforeEachTest()
        {
            app = AppInitializer.StartApp(platform);

            Thread.Sleep(TimeSpan.FromSeconds(5));

            if (app.Query("SIGN IN").Any())
            {
                new SplashScreenPage(app, platform)
                        .ExitSplashScreen();
            }

            //waiting for next screen to load to 
            Thread.Sleep(TimeSpan.FromSeconds(5));

            if (app.Query(x => x.WebView()).Any())
            {
                LogIn();
            }

            Thread.Sleep(TimeSpan.FromSeconds(5));
            app.WaitForNoElement("Loading sales data...");
            //Refreshing the data on home page
//            new GlobalPage(app, platform)
//                .navigateToProducts();
//
//            new GlobalPage(app, platform)
//                .navigateToSales();
//
            app.Screenshot("On Home Page");
        }
 /// <summary>
 /// This is a javascript application.
 /// </summary>
 /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
 public Application(IApp page)
 {
     content.AttachControlTo(page.Content);
     //content.AutoSizeControlTo(page.ContentSize);
     @"Hello world".ToDocumentTitle();
  
 }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // Initialize ApplicationSprite
            sprite.AttachSpriteTo(page.Content);

            sprite.Invoke(
                base64 =>
                {
                    var bytes = Convert.FromBase64String(base64);

                    new IHTMLPre { innerText = bytes.ToHexString() }.AttachToDocument();

                    var r = new BinaryReader(new MemoryStream(bytes));

                    var space = r.ReadByte();

                    new IHTMLPre { innerText = new { space }.ToString() }.AttachToDocument();

                    try
                    {
                        // implemented in Redux build configuration
                        // script: error JSC1000: No implementation found for this native method, please implement [System.IO.BinaryReader.ReadSingle()]
                        var f = r.ReadSingle();

                        new IHTMLPre { innerText = new { f }.ToString() }.AttachToDocument();
                    }
                    catch (Exception ex)
                    {
                        new IHTMLPre { innerText = "error: " + new { ex.Message }.ToString() }.AttachToDocument();
                    }
                }
            );
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            var controls = new[] { 
                content.vjLogoComponent4,
                content.vjLogoComponent5
            };
            foreach (Component item in controls)
            {
                (item as ImageLinkComponent).With(
                    c =>
                    {
                        var a = new IHTMLAnchor { href = c.href }.AttachToDocument();

                        c.img.AttachTo(a);

                        //a.style.SetLocation(c.Left, c.Top);
                    }
                );
            }

            //content.AttachControlTo(page.Content);
            //content.AutoSizeControlTo(page.ContentSize);
            @"Hello world".ToDocumentTitle();
            // Send data from JavaScript to the server tier
            service.WebMethod2(
                @"A string from JavaScript.",
                value => value.ToDocumentTitle()
            );
        }
		public void SetUp()
		{
			if (TestEnvironment.Platform.Equals(TestPlatform.TestCloudiOS))
			{
                // Setup the screenQueries
                _screenQueries = new iOSScreenQueries();

                _isIos = true;

                // configure the app
				_app = ConfigureApp
					.iOS
					.StartApp();
			}
			else if (TestEnvironment.Platform.Equals(TestPlatform.TestCloudAndroid))
			{
                // Setup the screenQueries
                _screenQueries = new AndroidScreenQueries();

                // configure the app
                _app = ConfigureApp
                    .Android
                    .StartApp();
			}
			else if (TestEnvironment.Platform.Equals(TestPlatform.Local))
			{
				// NOTE Enable or disable the lines depending on what platform you want ot test
//				SetupForiOSLocalTesting ();				
                SetupForAndroidLocalTesting();
			}
			else
			{
				throw new NotImplementedException(String.Format("I don't know this platform {0}", TestEnvironment.Platform));
			}
		}
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            this.ScreenWidth = Native.window.screen.width;
            this.ScreenHeight = Native.window.screen.height;

            this.ScreenChanged();
        }
 public static void MyClassInitialize(TestContext testContext)
 {
     IConfigSource configSource = Helper.ConfigSource_EventStore_SqlExpress;
     application = AppRuntime.Create(configSource);
     application.Initialize += new System.EventHandler<AppInitEventArgs>(Helper.AppInit_EventStore_SqlExpress);
     application.Start();
 }
Example #10
0
File: AppView.cs Project: konzuk/KZ
        private void ItemClick(IApp app)
        {
            if (app != null)
            {
                KZHelper.KZAsynchronousTask.StartTask<IContentView>(delegate
                {
                    if (!DicViews.ContainsKey(app.Id))
                    {
                        if (KZHelper.Container.IsRegistered<IContentView>(app.Code))
                        {
                            var view = KZHelper.Container.Resolve<IContentView>(app.Code);
                            view.Owner = this;
                            view.LoadAppFunction(app);
                            DicViews.Add(app.Id, view);

                        }
                        else
                        {
                            var view = new BlankView(KZHelper.Container);
                            DicViews.Add(app.Id, view);

                        }
                    }
                    return DicViews[app.Id];
                }, delegate(Task<IContentView> task)
                {
                    
                    LoadView(task.Result as Control);

                    _tileNav.AdjustTitle(app, IsHome);
                });
            }
            
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page = null)
        {
            if (page == null)
                return;

            Initialize(page);
        }
Example #12
0
 public void DoSetup()
 {
     mFactory = new Factory(new DefaultModuleConfiguration(), new ITModuleConfiguration());
       mObserver = (RecordingObserver)mFactory.Build<IMessageObserver>();
       mApp = mFactory.Build<IApp>();
       mFile = new DotNetFile();
 }
Example #13
0
		///-------------------------------------------------------------------------------
		/// <summary>
		/// Constructor for import dialog, requiring a language project.
		/// Use this constructor at run time.
		/// </summary>
		///-------------------------------------------------------------------------------
		public ImportDialog(FwStyleSheet styleSheet, FdoCache cache, IScrImportSet settings,
			IHelpTopicProvider helpTopicProvider, IApp app) : this()
		{
			m_StyleSheet = styleSheet;
			m_helpTopicProvider = helpTopicProvider;
			m_app = app;
			m_scr = cache.LangProject.TranslatedScriptureOA;
			m_importSettings = settings;

			//InitBookNameList();

			// Set the initial values for the controls from the static variables.
			radImportEntire.Checked = ImportEntire;
			radImportRange.Checked = !ImportEntire;
			chkTranslation.Checked = ImportTranslation;
			chkBackTranslation.Checked = ImportBackTranslation;
			chkBookIntros.Checked = ImportBookIntros;
			chkOther.Checked = ImportAnnotations;

			// Restore any saved settings.
			if (s_StartRef != null)
				StartRef = s_StartRef;
			else
				SetStartRefToFirstImportableBook();

			if (s_EndRef != null)
				EndRef = s_EndRef;
			else
				SetEndRefToLastImportableBook();

			// Finish constructing the ScrBookControl objects.
			InitializeStartAndEndRefControls();
		}
Example #14
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FwApplyStyleDlg"/> class.
		/// </summary>
		/// <param name="rootSite">The root site.</param>
		/// <param name="cache">The cache.</param>
		/// <param name="hvoStylesOwner">The hvo of the object which owns the style.</param>
		/// <param name="stylesTag">The "flid" in which the styles are owned.</param>
		/// <param name="normalStyleName">Name of the normal style.</param>
		/// <param name="customUserLevel">The custom user level.</param>
		/// <param name="paraStyleName">Name of the currently selected paragraph style.</param>
		/// <param name="charStyleName">Name of the currently selected character style.</param>
		/// <param name="hvoRootObject">The hvo of the root object in the current view.</param>
		/// <param name="app">The application.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public FwApplyStyleDlg(IVwRootSite rootSite, FdoCache cache, int hvoStylesOwner,
			int stylesTag, string normalStyleName, int customUserLevel, string paraStyleName,
			string charStyleName, int hvoRootObject, IApp app,
			IHelpTopicProvider helpTopicProvider)
		{
			m_rootSite = rootSite;
			InitializeComponent();
			m_customUserLevel = customUserLevel;
			m_helpTopicProvider = helpTopicProvider;
			m_paraStyleName = paraStyleName;
			m_charStyleName = charStyleName;

			// Cache is null in tests
			if (cache == null)
				return;

			m_cboTypes.SelectedIndex = 1; // All Styles

			// Load the style information
			m_styleTable = new StyleInfoTable(normalStyleName,
				cache.ServiceLocator.WritingSystemManager);
			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(cache, hvoStylesOwner, stylesTag);
			m_styleListHelper = new StyleListBoxHelper(m_lstStyles);
			m_styleListHelper.ShowInternalStyles = false;
		}
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // what about gif, svg, canvas and webgl?
            Native.document.icon = new fullbox();

            new IHTMLButton { "?" }.AttachToDocument().WhenClicked(
                 button =>
                 {
                     var div = new IHTMLDiv { "?" };

                     // 7x20
                     div.style.color = "red";
                     div.style.width = "16px";
                     div.style.height = "16px";

                     IHTMLImage i = div;

                     var c = new CanvasRenderingContext2D(16, 16);

                     c.drawImage(i, 0, 0, 16, 16);


                     Native.css.style.cursorImage = i;

                     // Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
                     // why wont this work?
                     Native.document.icon = c.canvas.toDataURL();


                 }
            );
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {

            var switchto = new Abstractatech.Services.idearemixer.ApplicationLoader();


        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {

            page.DragMe.onmousedown +=
                async e =>
                {
                    e.CaptureMouse();
                    page.DragMe.style.color = "red";

                    //new IHTMLPre { () => await page.DragMe.async.onmousemove }.AttachToDocument();

                    var up = await page.DragMe.async.onmouseup;

                    page.DragMe.style.color = "";

                    var w = new IWindow();

                    await w.async.onload;

                    w.document.title = "new IWindow";

                    w.moveTo(
                        up.CursorX,
                        up.CursorY
                    );


                };


        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // X:\jsc.svn\core\ScriptCoreLib.Async\ScriptCoreLib.Async\JavaScript\DOM\HTML\IHTMLButtonAsyncExtensions.cs

            //Uncaught SecurityError: Failed to execute 'pushState' on 'History': A history state object with URL 'http://www.xmonese.xavalon.net/#/sign+in' cannot be created in a document with origin 'http://my.monese.com'. 

            //Native.document.baseUri

            new IHTMLBase { href = "http://otherhost/" }.AttachToHead();

            Console.WriteLine("before Historic");
            page.ClickToEnterANewHistoricState.Historic(
                async scope =>
                {
                    Native.document.body.style.borderTop = "1em solid red";

                    await scope;
                    Native.document.body.style.borderTop = "0em solid red";
                }
            );

            page.ClickToEnterANewHistoricState2.Historic(
                 async scope =>
                 {
                     Native.document.body.style.borderLeft = "1em solid red";

                     await scope;
                     Native.document.body.style.borderLeft = "0em solid red";
                 }
             );
        }
Example #19
0
        public SalesHomePage(IApp app, Platform platform)
            : base(app, platform, "WEEKLY AVERAGE", "WEEKLY AVERAGE")
        {
            if (OnAndroid)
            {
                FirstLead = x => x.Marked("50% - Value Proposition");
                ListView = x => x.Id("content");
                AddLeadButton = x => x.Class("FloatingActionButton");
                LeadCell = x => x.Class("ViewCellRenderer_ViewCellContainer");
                ChartIdentifier = x => x.Id("stripLinesLayout");
            }
            if (OniOS)
            {
                FirstLead = x => x.Class("UITableViewCellContentView");
                ListView = x => x.Class("UILayoutContainerView");
                AddLeadButton = x => x.Id("add_ios_gray");
            }

            //Verifying page has loaded
            app.WaitForElement(LeadCell);
            app.WaitForElement(ChartIdentifier);

            app.WaitForNoElement(SalesDataLoading, timeout: TimeSpan.FromSeconds(20));
            app.WaitForNoElement(LeadsLoading, timeout: TimeSpan.FromSeconds(20));
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // Upcoming%20Features%20in%20CSharp%20-%20Preview.pdf
            // X:\jsc.svn\examples\javascript\Test\TestStringInterpolation\TestStringInterpolation\Application.cs

            new IHTMLPre { "name: \{this.Name}" }.AttachToDocument();
        }
Example #21
0
        public IApp Create(IConfigSource configSource) 
        {
            if (configSource.Config == null ||
                configSource.Config.Application == null)
            {
                throw new ConfigException("Either EApp configuration or EApp application configuration has not been initialized in the ConfigSource instance.");
            }

            string typeName = configSource.Config.Application.Provider;

            if (string.IsNullOrEmpty(typeName))
            {
                throw new ConfigException("The provider type of the Application has not been defined in the ConfigSource yet.");
            }

            Type appType = Type.GetType(typeName);

            if (appType == null)
            {
                throw new InfrastructureException("The application provider defined by type '{0}' doesn't exist.", typeName);
            }

            IApp app = (IApp)Activator.CreateInstance(appType);

            this.currrentApplication = app;

            return this.currrentApplication;
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            var ImagesThatAreCurrentlyLoading = new List<IHTMLImage>();
            var ImagesThatAreCurrentlyLoadingCounter = 0;



            //          // Test453StartLoadingSingleImage.Tycoon4+<>c__DisplayClass0.<.ctor>b__2
            //          type$a5BarLoBUjK8R1JTOyKDbw.BAAABroBUjK8R1JTOyKDbw = function(b)
            //{
            //              var a = [this], c;

            //              c = a[0].ImagesThatAreCurrentlyLoadingCounter;
            //              a[0].ImagesThatAreCurrentlyLoadingCounter = (((c + 1)));
            //          };

            #region StartLoadingSingleImage
            // X:\jsc.svn\examples\javascript\Test\TestWeb453StartLoadingSingleImage\TestWeb453StartLoadingSingleImage\Application.cs
            // X:\jsc.svn\examples\javascript\IsometricTycoonViewWithToolbar\IsometricTycoonViewWithToolbar\Library\Tycoon4.cs
            // X:\jsc.svn\examples\javascript\Test\Test453StartLoadingSingleImage\Test453StartLoadingSingleImage\Class1.cs
            Action<IHTMLImage> StartLoadingSingleImage = Image =>
            {
                ImagesThatAreCurrentlyLoading.Add(Image);

                Image.InvokeOnComplete(img => { ImagesThatAreCurrentlyLoadingCounter++; }, 30);
                //LoadingSingleImageDone(Image);
            };
            #endregion
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {

            new IHTMLButton { innerText = "send" }.AttachToDocument().WhenClicked(
                async delegate
                {

                    await new ApplicationWebService
                    {
                        FromAddress = "*****@*****.**",
                        FromName = "Example.com Admin",

                        ToAddress = "*****@*****.**",
                        ToName = "Mr. User",

                        Subject = "foo",

                        MessageString = "hello world"
                    }.SendEMail();


                }
            );

        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2014/201404/20140412

            // also show how does this relate to Workers async and localstorage, historic api
            // what about service worker?

            var state = "binary state?";
            var state64 = Convert.ToBase64String(Encoding.UTF8.GetBytes(state));

            // at default location?
            if (Native.document.location.hash == "")
            {
                new IHTMLAnchor
                {
                    target = "_blank",
                    href = "#" + state64,
                    innerText = "click to continue"
                }.AttachToDocument();
            }
            else
            {
                var newstate = Encoding.UTF8.GetString(
                    Convert.FromBase64String(Native.document.location.hash.SkipUntilOrEmpty("#"))
                );

                new IHTMLPre { new { newstate } }.AttachToDocument();


            }
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {


            new { }.With(
                async delegate
                {
                    // what about IL mutation, and code patching?
                    while (await Native.body.async.onmutation)
                    {
                        //Native.body.css.style.transition = "\{Native.body.css.style.backgroundColor} 0ms linear";
                        Native.body.css.style.transition = "background-color 0ms linear";
                        Native.body.css.style.backgroundColor = "yellow";
                        await Task.Delay(1);
                        Native.body.css.style.transition = "background-color 800ms linear";
                        Native.body.css.style.backgroundColor = "cyan";
                    }
                }
            );

            Native.document.onclick +=
                e =>
                {
                    Native.body.innerText = new
                    {
                        e.CursorX,
                        e.CursorY
                    }.ToString();
                };
        }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // http://alteredqualia.com/css-shaders/crumple.html

            page.shader.MakeCSSShaderCrumple();

        }
Example #27
0
        protected BasePage(IApp app, Platform platform)
        {
            this.app = app;

            OnAndroid = platform == Platform.Android;
            OniOS = platform == Platform.iOS;
        }
 /// <summary>
 /// This is a javascript application.
 /// </summary>
 /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
 public Application(IApp page)
 {
     service.WebMethod2(
         @"A string from JavaScript.",
         value => new IHTMLPre { innerText = value }.AttachToDocument()
     );
 }
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // X:\jsc.svn\examples\javascript\Test\Test453ForEach\Test453ForEach\Class1.cs
            // script: error JSC1000: unknown while condition at Void Complete(Byte[], System.Net.WebClient). Maybe you did not turn off c# compiler 'optimize code' feature?
            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/201501/20150102

            // whats the references/ analyzers/ ?
            // X:\jsc.svn\examples\javascript\async\Test\Test453Async\Test453Async\Program.cs

            new { }.With(
                async scope =>
                {
                    // http://www.slideshare.net/RyanAnklam/rethink-async-with-rxjs

                    // works with 2012 web update4, with 2015
                    // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/20150101/async

                    Native.css.style.backgroundColor = "yellow";

                    //await Native.document.onmouseover;
                    //await Native.document.async.onm;
                    await Native.document.body.async.onmouseover;

                    Native.css.style.backgroundColor = "cyan";

                }
            );

        }
Example #30
0
        public override void Initialize(IApp app)
        {
            //重新设置主窗体。
            App.MainWindowType = typeof(EmptyShell);
            //不需要登录界面。
            ClientApp.LoginWindowType = null;
            //不需要任何权限。
            PermissionMgr.Provider = null;

            app.AllPluginsIntialized += (oo, ee) =>
            {
                RafyResources.AddResource(typeof(MonthPlanPlugin), "Resources/MonthPlanResources.xaml");
            };

            app.ModuleOperations += (o, e) =>
            {
                CommonModel.Modules.AddRoot(new WPFModuleMeta { Label = "月度计划", EntityType = typeof(MonthPlan), BlocksTemplate = typeof(MonthPlanModule) });
            };

            app.RuntimeStarting += (o, e) =>
            {
                AutoUpdateDb();
            };

            app.StartupCompleted += (o, e) =>
            {
                App.Current.OpenModuleOrAlert("月度计划");
            };
        }
Example #31
0
 public override void Initialize(IApp app)
 {
     RafyEnvironment.Provider.Translator = DbTranslator.Instance;
 }
Example #32
0
 public static object InvokeBackdoorMethod(this IApp app, string backdoorMethodName, string parameter = "") => app switch
 {
Example #33
0
 public static void SetGitHubUser(IApp app, string accessToken) =>
 InvokeBackdoorMethod(app, BackdoorMethodConstants.SetGitHubUser, accessToken);
Example #34
0
 /// <summary>
 /// A shorthand for getting the current time
 /// from the registered <see cref="ITimeService"/>.
 /// </summary>
 /// <param name="app">The currently running application.</param>
 /// <returns>The current <see cref="DateTime"/>.</returns>
 public static DateTime GetTime(this IApp app)
 {
     return(app.GetTimeService().GetTime());
 }
Example #35
0
 /// <summary>
 /// Gets the application's currently registered <see cref="ITimeService"/>
 /// </summary>
 /// <param name="app">The application.</param>
 /// <returns>The registered time service.</returns>
 public static ITimeService GetTimeService(this IApp app)
 {
     return((ITimeService)app.Get(typeof(ITimeService)));
 }
Example #36
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // the idea of this exammple
            // is to look at how multiple shaders can be linked to work together.
            // we need two shaders
            // first we could run them as separate programs in pip mode
            // selected by the host/javascript
            // then repeat the same experiment, but have the shader do the pip in a single program
            // later shader code could be nugeted
            // lets have a copy of
            // X:\jsc.svn\examples\javascript\chrome\apps\WebGL\ChromeShaderToyQuadraticBezierByMattdesl\ChromeShaderToyQuadraticBezierByMattdesl\Shaders\Program.frag
            // locally should we need to modify it..

            // can we change colors?


            // https://www.shadertoy.com/view/lsSGRz

            #region += Launched chrome.app.window
            dynamic self               = Native.self;
            dynamic self_chrome        = self.chrome;
            object  self_chrome_socket = self_chrome.socket;

            if (self_chrome_socket != null)
            {
                if (!(Native.window.opener == null && Native.window.parent == Native.window.self))
                {
                    Console.WriteLine("chrome.app.window.create, is that you?");

                    // pass thru
                }
                else
                {
                    // should jsc send a copresence udp message?
                    chrome.runtime.UpdateAvailable += delegate
                    {
                        new chrome.Notification(title: "UpdateAvailable");
                    };

                    chrome.app.runtime.Launched += async delegate
                    {
                        // 0:12094ms chrome.app.window.create {{ href = chrome-extension://aemlnmcokphbneegoefdckonejmknohh/_generated_background_page.html }}
                        Console.WriteLine("chrome.app.window.create " + new { Native.document.location.href });

                        new chrome.Notification(title: "ChromeUDPSendAsync");

                        var xappwindow = await chrome.app.window.create(
                            Native.document.location.pathname, options : null
                            );

                        //xappwindow.setAlwaysOnTop

                        xappwindow.show();

                        await xappwindow.contentWindow.async.onload;

                        Console.WriteLine("chrome.app.window loaded!");
                    };


                    return;
                }
            }
            #endregion

            new { }.With(
                async delegate


                //02000047 <module>.SHA1111132814b0387cee18e0fe5efe63eb881cfd505@901285072
                //02000048 GLSLShaderToyPip.Application+<AttachToDocument>d__1+<MoveNext>06000020
                //script: error JSC1000:
                //error:
                //  statement cannot be a load instruction(or is it a bug?)
                //  [0x0000]
                //		ldarg.0    +1 -0

                //public static async void AttachToDocument()
                //public async void AttachToDocument()
            {
                Native.body.style.margin = "0px";
                (Native.body.style as dynamic).webkitUserSelect = "auto";


                var gl = new WebGLRenderingContext(alpha: true);

                #region GPU process was unable to boot
                if (gl == null)
                {
                    new IHTMLPre {
                        // https://code.google.com/p/chromium/issues/detail?id=294207
                        "Rats! WebGL hit a snag. \n WebGL: Unavailable.\n GPU process was unable to boot. \n restart chrome.",

                        // chrome sends us to about:blank?
                        //new IHTMLAnchor {

                        //	target = "_blank",

                        //	href = "about:gpu", innerText = "about:gpu",

                        //	// http://tirania.org/blog/archive/2009/Jul-27-1.html
                        //	//onclick += de
                        //}
                        //.With(a => {  a.onclick += e => { e.preventDefault();  Native.window.open("about:gpu"); }; } )
                    }.AttachToDocument();
                    return;
                }
                #endregion



                var c = gl.canvas.AttachToDocument();

                #region oncontextlost
                gl.oncontextlost +=
                    e =>
                {
                    //[12144:10496:0311 / 120850:ERROR: gpu_watchdog_thread.cc(314)] : The GPU process hung. Terminating after 10000 ms.
                    //   GpuProcessHostUIShim: The GPU process crashed!
                    gl.canvas.Orphanize();

                    new IHTMLPre {
                        // https://code.google.com/p/chromium/issues/detail?id=294207
                        @"Rats! WebGL hit a snag.
oncontextlost.
The GPU process hung. Terminating. 
check chrome://gpu for log messages.  
do we have a stack trace?

" + new { e.statusMessage },

                        // chrome sends us to about:blank?
                        //new IHTMLAnchor {

                        //	target = "_blank",

                        //	href = "about:gpu", innerText = "about:gpu",

                        //	// http://tirania.org/blog/archive/2009/Jul-27-1.html
                        //	//onclick += de
                        //}
                        //.With(a => {  a.onclick += e => { e.preventDefault();  Native.window.open("about:gpu"); }; } )
                    }.AttachToDocument();
                };
                #endregion


                #region onresize
                new { }.With(
                    async delegate
                {
                    do
                    {
                        c.width  = Native.window.Width;
                        c.height = Math.Min(300, Native.window.Height);
                        c.style.SetSize(c.width, c.height);
                    }while (await Native.window.async.onresize);
                }
                    );
                #endregion



                #region CaptureMouse
                var mMouseOriX = 0;
                var mMouseOriY = 0;
                var mMousePosX = c.width / 2;
                var mMousePosY = 0;

                c.onmousedown += ev =>
                {
                    mMouseOriX = ev.CursorX;
                    mMouseOriY = ev.CursorY;
                    mMousePosX = mMouseOriX;
                    mMousePosY = mMouseOriY;

                    ev.CaptureMouse();
                };

                c.onmousemove += ev =>
                {
                    if (ev.MouseButton == IEvent.MouseButtonEnum.Left)
                    {
                        mMousePosX = ev.CursorX;
                        mMousePosY = c.height - ev.CursorY;
                    }
                };


                c.onmouseup += ev =>
                {
                    mMouseOriX = -Math.Abs(mMouseOriX);
                    mMouseOriY = -Math.Abs(mMouseOriY);
                };
                #endregion

                var quadVBO = ShaderToy.createQuadVBO(gl);

                var pass1 = new ShaderToy.EffectPass(
                    gl: gl,
                    precission: ShaderToy.DetermineShaderPrecission(gl),
                    supportDerivatives: gl.getExtension("OES_standard_derivatives") != null,
                    quadVBO: quadVBO
                    );
                pass1.MakeHeader_Image();
                var frag1 = new GLSLShaderToyPip.Shaders.TheColorGradientFragmentShader();
                pass1.NewShader_Image(frag1);

                var pass0 = new ShaderToy.EffectPass(
                    gl: gl,
                    precission: ShaderToy.DetermineShaderPrecission(gl),
                    supportDerivatives: gl.getExtension("OES_standard_derivatives") != null,
                    quadVBO: quadVBO
                    );
                pass0.MakeHeader_Image();
                var frag0 = new GLSLShaderToyPip.Shaders.ChromeShaderToyQuadraticBezierByMattdeslFragmentShader();
                //var frag = new GLSLShaderToyPip.Shaders.TheColorGradientFragmentShader();
                pass0.NewShader_Image(frag0);

                if (pass0.xCreateShader.mProgram == null)
                {
                    gl.Orphanize();
                    return;
                }

                new { }.With(
                    async delegate
                {
                    do
                    {
                        Native.document.body.style.backgroundColor = "cyan";
                        await Task.Delay(500);
                        Native.document.body.style.backgroundColor = "yellow";
                        await Task.Delay(500);
                    } while (await Native.window.async.onframe);
                }
                    );



                // https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext

                #region Paint_Image
                Paint_ImageDelegate Paint_Image =
                    (mProgram, time, mouseOriX, mouseOriY, mousePosX, mousePosY) =>
                {
                    var viewportxres = gl.canvas.width;
                    var viewportyres = gl.canvas.height;

                    #region Paint_Image
                    //new IHTMLPre { "enter Paint_Image" }.AttachToDocument();

                    // http://www.html5rocks.com/en/tutorials/webgl/webgl_fundamentals/
                    //gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
                    gl.viewport(0, 0, viewportxres, viewportyres);


                    // alpha to zero will only hide the pixel if blending is enabled.
                    gl.useProgram(mProgram);

                    // uniform4fv
                    var mouse = new[] { mousePosX, mousePosY, mouseOriX, mouseOriY };

                    var l2 = gl.getUniformLocation(mProgram, "iGlobalTime"); if (l2 != null)
                    {
                        gl.uniform1f(l2, time);
                    }
                    var l3 = gl.getUniformLocation(mProgram, "iResolution"); if (l3 != null)
                    {
                        gl.uniform3f(l3, viewportxres, viewportyres, 1.0f);
                    }
                    var l4 = gl.getUniformLocation(mProgram, "iMouse"); if (l4 != null)
                    {
                        gl.uniform4fv(l4, mouse);
                    }
                    //var l7 = gl.getUniformLocation(this.mProgram, "iDate"); if (l7 != null) gl.uniform4fv(l7, dates);
                    //var l9 = gl.getUniformLocation(this.mProgram, "iSampleRate"); if (l9 != null) gl.uniform1f(l9, this.mSampleRate);

                    var ich0 = gl.getUniformLocation(mProgram, "iChannel0"); if (ich0 != null)
                    {
                        gl.uniform1i(ich0, 0);
                    }
                    var ich1 = gl.getUniformLocation(mProgram, "iChannel1"); if (ich1 != null)
                    {
                        gl.uniform1i(ich1, 1);
                    }
                    var ich2 = gl.getUniformLocation(mProgram, "iChannel2"); if (ich2 != null)
                    {
                        gl.uniform1i(ich2, 2);
                    }
                    var ich3 = gl.getUniformLocation(mProgram, "iChannel3"); if (ich3 != null)
                    {
                        gl.uniform1i(ich3, 3);
                    }



                    //for (var i = 0; i < mInputs.Length; i++)
                    //{
                    //	var inp = mInputs[i];

                    //	gl.activeTexture((uint)(gl.TEXTURE0 + i));

                    //	if (inp == null)
                    //	{
                    //		gl.bindTexture(gl.TEXTURE_2D, null);
                    //	}
                    //}

                    var times = new[] { 0.0f, 0.0f, 0.0f, 0.0f };
                    var l5    = gl.getUniformLocation(mProgram, "iChannelTime");
                    if (l5 != null)
                    {
                        gl.uniform1fv(l5, times);
                    }

                    var resos = new float[12] {
                        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f
                    };
                    var l8 = gl.getUniformLocation(mProgram, "iChannelResolution");
                    if (l8 != null)
                    {
                        gl.uniform3fv(l8, resos);
                    }



                    // using ?
                    var l1 = (uint)gl.getAttribLocation(mProgram, "pos");
                    gl.bindBuffer(gl.ARRAY_BUFFER, quadVBO);
                    gl.vertexAttribPointer(l1, 2, gl.FLOAT, false, 0, 0);
                    gl.enableVertexAttribArray(l1);

                    gl.drawArrays(gl.TRIANGLES, 0, 6);
                    // first frame is now visible
                    gl.disableVertexAttribArray(l1);
                    #endregion

                    //mFrame++;
                };
                #endregion


                var sw = Stopwatch.StartNew();
                do
                {
                    pass1.Paint_Image(
                        sw.ElapsedMilliseconds / 1000.0f,

                        mMouseOriX,
                        mMouseOriY,
                        mMousePosX,
                        mMousePosY,

                        zoom: 1.0f
                        );

                    pass0.Paint_Image(
                        sw.ElapsedMilliseconds / 1000.0f,

                        mMouseOriX,
                        mMouseOriY,
                        mMousePosX,
                        mMousePosY,

                        //zoom: 0.5f
                        zoom: mMousePosX / (float)c.width
                        );

                    // what does it do?
                    gl.flush();
                }while (await Native.window.async.onframe);
            }
                );
        }
 /// <summary>
 /// This is a javascript application.
 /// </summary>
 /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
 public Application(IApp page)
 {
 }
Example #38
0
        public static void Main(string[] args)
        {
            app = new MeadowApp();

            Thread.Sleep(Timeout.Infinite);
        }
Example #39
0
 public void TestFixtureSetUp()
 {
     _app = ConfigureApp.Android.StartApp();
 }
Example #40
0
        public static void NavigateToIssue(Type type, IApp app)
        {
            var typeIssueAttribute = type.GetTypeInfo().GetCustomAttribute <IssueAttribute>();

            string cellName = "";

            if (typeIssueAttribute.IssueTracker.ToString() != "None" &&
                typeIssueAttribute.IssueNumber != 1461 &&
                typeIssueAttribute.IssueNumber != 342)
            {
                cellName = typeIssueAttribute.DisplayName;
            }
            else
            {
                cellName = typeIssueAttribute.Description;
            }

            int maxAttempts = 2;
            int attempts    = 0;

            while (attempts < maxAttempts)
            {
                attempts += 1;

                try
                {
                    // Attempt the direct way of navigating to the test page
#if __ANDROID__
                    if (bool.Parse((string)app.Invoke("NavigateToTest", cellName)))
                    {
                        return;
                    }
#endif
#if __IOS__
                    if (bool.Parse(app.Invoke("navigateToTest:", cellName).ToString()))
                    {
                        return;
                    }
#endif

#if __WINDOWS__
                    // Windows doens't have an 'invoke' option right now for us to do the more direct navigation
                    // we're using for Android/iOS
                    // So we're just going to use the 'Reset' method to bounce the app to the opening screen
                    // and then fall back to the old manual navigation
                    WindowsTestBase.Reset();
#endif
                }
                catch (Exception ex)
                {
                    var debugMessage = $"Could not directly invoke test; using UI navigation instead. {ex}";

                    System.Diagnostics.Debug.WriteLine(debugMessage);
                    Console.WriteLine(debugMessage);
                }

                try
                {
                    // Fall back to the "manual" navigation method
                    app.Tap(q => q.Button("Go to Test Cases"));
                    app.WaitForElement(q => q.Raw("* marked:'TestCasesIssueList'"));

                    app.EnterText(q => q.Raw("* marked:'SearchBarGo'"), cellName);

                    app.WaitForElement(q => q.Raw("* marked:'SearchButton'"));
                    app.Tap(q => q.Raw("* marked:'SearchButton'"));

                    return;
                }
                catch (Exception ex)
                {
                    var debugMessage = $"Both navigation methods failed. {ex}";

                    System.Diagnostics.Debug.WriteLine(debugMessage);
                    Console.WriteLine(debugMessage);

                    if (attempts < maxAttempts)
                    {
                        // Something has failed and we're stuck in a place where we can't navigate
                        // to the test. Usually this is because we're getting network/HTTP errors
                        // communicating with the server on the device. So we'll try restarting the app.
                        RunningApp = InitializeApp();
                    }
                    else
                    {
                        // But if it's still not working after [maxAttempts], we've got assume this is a legit
                        // problem that restarting won't fix
                        throw;
                    }
                }
            }
        }
Example #41
0
        public static void TrySigningUpAndFail(this IApp app)
        {
            app.Tap(Login.NextButton);

            app.WaitForElement(Login.ErrorLabel);
        }
 public void BeforeEachTest()
 {
     app = AppInitializer.StartApp(platform);
 }
Example #43
0
 public static void GoBackToOnboardingScreen(this IApp app)
 {
     app.PerformBack(Login.BackButton);
     app.WaitForElement(Onboarding.LoginButton);
 }
Example #44
0
        public static void SignUpSuccesfully(this IApp app)
        {
            app.Tap(Login.NextButton);

            app.WaitForElement(Main.StartTimeEntryButton);
        }
Example #45
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            // certmgr.msc

            Native.document.icon = null;


            //#1a < 001a 0x166c bytes
            //#05 < 0005 0x0576 bytes
            new IHTMLButton {
                "go wild"
            }.AttachToDocument()
            //.WhenClicked(

            .With(
                //async
                delegate
            {
                // X-DevTools-Emulate-Network-Conditions-Client-Id:7C66E13B-14BC-4006-BAC1-9EE2D3AC0591

                // can we disable the implicit favicon request?
                //Native.document.icon = new IHTMLImage { };
                // #1a < 001a 0x0b04 bytes


                //Native.document.icon.AttachToDocument();

                // favicon to fail?
                //await Task.Delay(300);
                //await Native.window.async.onframe;


                // there is a secondary / request?
                //return;

                //Native.window.requestAnimationFrame += delegate
                {
                    // https://code.google.com/p/chromium/issues/detail?id=543982&thanks=543982&ts=1444983390

                    Console.WriteLine("about to init sides...");
                    #region sides
                    var sides = new IHTMLImage[]
                    {
                        new azi_px(),

                        new azi_nx(),

                        new azi_py(),

                        new azi_ny(),

                        new azi_pz(),


                        // #18 < 0018 0x0550 bytes

                        new azi_nz(),
                    };
                    #endregion
                    Console.WriteLine("about to init CSS3DObject sides... did chrome just abuse TCP ?");
                };
            }
                );
        }
Example #46
0
 public static void GoBackToEmailScreen(this IApp app)
 {
     app.PerformBack(Login.BackButton);
     app.WaitForElement(Login.EmailText);
 }
Example #47
0
 public SwitchPage1(IApp app, Platform platform) : base(app, platform)
 {
 }
Example #48
0
 public static void GoToPasswordScreen(this IApp app)
 {
     app.Tap(Login.NextButton);
     app.WaitForElement(Login.PasswordText);
 }
Example #49
0
 public static void NavigateToGallery(this IApp app, string page)
 {
     NavigateToGallery(app, page, null);
 }
Example #50
0
 public virtual IMemberApp GetByApp(IApp app)
 {
     return(GetByApp(app.GetType(), app.Id));
 }
Example #51
0
 public static AppRect ScreenBounds(this IApp app)
 {
     return(app.Query(Queries.Root()).First().Rect);
 }
 /// <summary>
 /// Gets the currently loaded cron scheduled event hub.
 /// </summary>
 /// <param name="app">The current application.</param>
 /// <returns>The event hub.</returns>
 public static ICronScheduledEventHub GetCronScheduledEventHub(this IApp app) => (ICronScheduledEventHub)app.Get(typeof(ICronScheduledEventHub));
Example #53
0
 public override void Initialize(IApp app)
 {
     app.ModuleOperations     += app_ModuleOperations;
     app.AllPluginsIntialized += app_AllPluginsIntialized;
 }
Example #54
0
 public static void NavigateBack(this IApp app)
 {
     app.Back();
 }
 public RegistrationCompletedPage(IApp app) : base(app, "Registration Completed", _nextAttendee)
 {
 }
Example #56
0
        // Could not connect to the feed specified at 'http://my.jsc-solutions.net/nuget'. P


        public Application(IApp page)
        {
            //{ var ref0 = typeof(dirt_tx); }
            { var ref0 = new dirt_tx {
              }; }
            //{ var ref0 = typeof(MarineCv2_color); }
            { var ref0 = new MarineCv2_color {
              }; }

            // http://www.realitymeltdown.com/WebGL3/character-controller.html

            // https://sites.google.com/a/jsc-solutions.net/backlog/knowledge-base/2015/201501/20150127
            //Native.css
            Native.body.style.margin   = "0px";
            Native.body.style.overflow = IStyle.OverflowEnum.hidden;

            //Error CS0246  The type or namespace name 'THREE' could not be found(are you missing a using directive or an assembly reference?)	WebGLSpeedBlendCharacter Application.cs  46
            // used by, for?
            var clock = new THREE.Clock();
            //var keys = new { LEFT = 37, UP = 38, RIGHT = 39, DOWN = 40, A = 65, S = 83, D = 68, W = 87 };


            var scene    = new THREE.Scene();
            var skyScene = new THREE.Scene();

            scene.fog = new THREE.Fog(0xB0CAE1, 1000, 20000);
            scene.add(new THREE.AmbientLight(0xaaaaaa));

            var lightOffset = new THREE.Vector3(0, 1000, 1000.0);

            var light = new THREE.DirectionalLight(0xffffff, 1.5);

            light.position.copy(lightOffset);
            light.castShadow = true;

            var xlight = light as dynamic;

            xlight.shadowMapWidth      = 4096;
            xlight.shadowMapHeight     = 2048;
            xlight.shadowDarkness      = 0.5;
            xlight.shadowCameraNear    = 10;
            xlight.shadowCameraFar     = 10000;
            xlight.shadowBias          = 0.00001;
            xlight.shadowCameraRight   = 4000;
            xlight.shadowCameraLeft    = -4000;
            xlight.shadowCameraTop     = 4000;
            xlight.shadowCameraBottom  = -4000;
            xlight.shadowCameraVisible = true;

            scene.add(light);

            #region renderer
            var renderer = new THREE.WebGLRenderer(new { antialias = true, alpha = false });
            renderer.setSize(Native.window.Width, Native.window.Height);
            renderer.autoClear        = false;
            renderer.shadowMapEnabled = true;
            renderer.shadowMapType    = THREE.PCFSoftShadowMap;

            renderer.domElement.AttachToDocument();
            #endregion



            // this will mess up
            // three.OrbitControls.js
            // onMouseMove

            //new IStyle(renderer.domElement)
            //{
            //    position = IStyle.PositionEnum.absolute,
            //    left = "0px",
            //    top = "0px",
            //    right = "0px",
            //    bottom = "0px",
            //};


            //new { }.With(
            //    async delegate
            //    {

            //        await Native.window.async.onresize;

            //        // if the reload were fast, then we could actually do that:D
            //        Native.document.location.reload();

            //    }
            //);



            #region create field

            // THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint.
            //var planeGeometry = new THREE.PlaneGeometry(1000, 1000);
            //var planeMaterial = new THREE.MeshLambertMaterial(
            //    new
            //    {
            //        map = THREE.ImageUtils.loadTexture(new HTML.Images.FromAssets.dirt_tx().src),
            //        color = 0xffffff
            //    }
            //);

            //planeMaterial.map.repeat.x = 300;
            //planeMaterial.map.repeat.y = 300;
            //planeMaterial.map.wrapS = THREE.RepeatWrapping;
            //planeMaterial.map.wrapT = THREE.RepeatWrapping;
            //var plane = new THREE.Mesh(planeGeometry, planeMaterial);
            //plane.castShadow = false;
            //plane.receiveShadow = true;


            //{

            //    var parent = new THREE.Object3D();
            //    parent.add(plane);
            //    parent.rotation.x = -Math.PI / 2;
            //    parent.scale.set(100, 100, 100);

            //    scene.add(parent);
            //}

            var random    = new Random();
            var meshArray = new List <THREE.Mesh>();
            //var geometry = new THREE.CubeGeometry(1, 1, 1);
            var geometry = new THREE.BoxGeometry(1, 1, 1);

            for (var i = 1; i < 100; i++)
            {
                var ii = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial(
                                            new
                {
                    color = (Convert.ToInt32(0xffffff * random.NextDouble()))
                }));
                ii.position.x = i % 2 * 500 - 2.5f;

                // raise it up
                ii.position.y    = .5f * 100;
                ii.position.z    = -1 * i * 400;
                ii.castShadow    = true;
                ii.receiveShadow = true;
                //ii.scale.set(100, 100, 100 * i);
                ii.scale.set(100, 100 * i, 100);


                meshArray.Add(ii);

                scene.add(ii);
            }
            #endregion



            var blendMesh = new THREE.SpeedBlendCharacter();


            blendMesh.load(
                new Models.marine_anims().Content.src,
                new Action(
                    delegate
            {
                // buildScene

                //blendMesh.rotation.y = Math.PI * -135 / 180;
                blendMesh.castShadow = true;
                // we cannot scale down we want our shadows
                //blendMesh.scale.set(0.1, 0.1, 0.1);

                scene.add(blendMesh);

                //var characterController = new THREE.CharacterController(blendMesh);

                // run
                blendMesh.setSpeed(1.0);

                var radius = blendMesh.geometry.boundingSphere.radius;


                Native.document.title = new { radius }.ToString();


                var camera = new THREE.PerspectiveCamera(45, Native.window.aspect, 1, 20000);
                camera.position.set(0.0, radius * 3, radius * 3.5);

                var skyCamera = new THREE.PerspectiveCamera(45, Native.window.aspect, 1, 20000);
                skyCamera.position.set(0.0, radius * 3, radius * 3.5);

                var controls = new THREE.OrbitControls(camera);
                //controls.noPan = true;


                var loader = new THREE.JSONLoader();
                loader.load(new Models.ground().Content.src,
                            new Action <THREE.Geometry, THREE.Material[]>(

                                (xgeometry, materials) =>
                {
                    // cannot see the ground?
                    var ground = new THREE.Mesh(xgeometry, materials[0]);
                    ground.scale.set(20, 20, 20);
                    ground.receiveShadow = true;
                    ground.castShadow    = true;
                    scene.add(ground);
                }
                                )
                            );

                #region  createSky
                // gearvr has photos360 app
                var urls = new[] {
                    new px().src, new nx().src,
                    new py().src, new ny().src,
                    new pz().src, new nz().src,
                };

                var textureCube = THREE.ImageUtils.loadTextureCube(urls);

                dynamic shader = THREE.ShaderLib["cube"];
                shader.uniforms["tCube"].value = textureCube;

                // We're inside the box, so make sure to render the backsides
                // It will typically be rendered first in the scene and without depth so anything else will be drawn in front
                var material = new THREE.ShaderMaterial(new
                {
                    fragmentShader = shader.fragmentShader,
                    vertexShader   = shader.vertexShader,
                    uniforms       = shader.uniforms,
                    depthWrite     = false,
                    side           = THREE.BackSide
                });

                // THREE.CubeGeometry has been renamed to THREE.BoxGeometry
                // The box dimension size doesn't matter that much when the camera is in the center.  Experiment with the values.
                //var skyMesh = new THREE.Mesh(new THREE.CubeGeometry(10000, 10000, 10000, 1, 1, 1), material);
                var skyMesh = new THREE.Mesh(new THREE.BoxGeometry(10000, 10000, 10000), material);
                //skyMesh.renderDepth = -10;


                skyScene.add(skyMesh);
                #endregion

                #region onframe
                Native.window.onframe +=
                    delegate
                {
                    var scale    = 1.0;
                    var delta    = clock.getDelta();
                    var stepSize = delta * scale;

                    if (stepSize > 0)
                    {
                        //characterController.update(stepSize, scale);
                        //gui.setSpeed(blendMesh.speed);

                        THREE.AnimationHandler.update(stepSize);
                        blendMesh.updateSkeletonHelper();
                    }

                    controls.center.copy(blendMesh.position);
                    controls.center.y += radius * 2.0;
                    controls.update();

                    var camOffset = camera.position.clone().sub(controls.center);
                    camOffset.normalize().multiplyScalar(750);
                    camera.position = controls.center.clone().add(camOffset);

                    skyCamera.rotation.copy(camera.rotation);



                    renderer.clear();
                    renderer.render(skyScene, skyCamera);
                    renderer.render(scene, camera);
                };
                #endregion


                #region onresize
                new { }.With(
                    async delegate
                {
                    do
                    {
                        camera.aspect = Native.window.aspect;
                        camera.updateProjectionMatrix();
                        renderer.setSize(Native.window.Width, Native.window.Height);
                    } while (await Native.window.async.onresize);
                }
                    );
                #endregion
            }
                    )
                );
        }
Example #57
0
 public void BeforeEachTest()
 {
     app = AppInitializer.StartApp(platform, AppDataMode.Clear);
 }
Example #58
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="SyncUndoAction"/> class.
 /// </summary>
 /// <param name="app">The application.</param>
 /// <param name="syncMsg">The sync message.</param>
 /// ------------------------------------------------------------------------------------
 public SyncUndoAction(IApp app, SyncMsg syncMsg)
 {
     m_app     = app;
     m_syncMsg = syncMsg;
 }
 public OptInEmailPage(IApp app) : base(app, "Email Optin", _emailTextbox)
 {
 }
Example #60
0
 public LayeredViewContainerRemote(IApp app, Enum formsType, string platformViewType)
     : base(app, formsType, platformViewType)
 {
 }