当前位置: 首页>>代码示例>>C#>>正文


C# IApp类代码示例

本文整理汇总了C#中IApp的典型用法代码示例。如果您正苦于以下问题:C# IApp类的具体用法?C# IApp怎么用?C# IApp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IApp类属于命名空间,在下文中一共展示了IApp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Application

 /// <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();
  
 }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:11,代码来源:Application.cs

示例2: Application

        /// <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();
                    }
                }
            );
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:37,代码来源:Application.cs

示例3: Application

        /// <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);
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:11,代码来源:Application.cs

示例4: Application

        /// <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();


                 }
            );
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:36,代码来源:Application.cs

示例5: ImportDialog

		///-------------------------------------------------------------------------------
		/// <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();
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:39,代码来源:ImportDialog.cs

示例6: Application

        /// <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 = "[email protected]",
                        FromName = "Example.com Admin",

                        ToAddress = "[email protected]",
                        ToName = "Mr. User",

                        Subject = "foo",

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


                }
            );

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:29,代码来源:Application.cs

示例7: Application

 /// <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()
     );
 }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:11,代码来源:Application.cs

示例8: Application

        /// <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();


            }
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:35,代码来源:Application.cs

示例9: Application

        /// <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();
                };
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:34,代码来源:Application.cs

示例10: Application

        /// <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();

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:11,代码来源:Application.cs

示例11: Application

        /// <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";

                }
            );

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:33,代码来源:Application.cs

示例12: Application

        /// <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
                    );


                };


        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:35,代码来源:Application.cs

示例13: Application

        /// <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
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:33,代码来源:Application.cs

示例14: FwApplyStyleDlg

		/// ------------------------------------------------------------------------------------
		/// <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;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:42,代码来源:FwApplyStyleDlg.cs

示例15: Initialize

        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("月度计划");
            };
        }
开发者ID:569550384,项目名称:Rafy,代码行数:29,代码来源:MonthPlanPlugin.cs


注:本文中的IApp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。