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


C# IRenderer.Render方法代码示例

本文整理汇总了C#中IRenderer.Render方法的典型用法代码示例。如果您正苦于以下问题:C# IRenderer.Render方法的具体用法?C# IRenderer.Render怎么用?C# IRenderer.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRenderer的用法示例。


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

示例1: Render

 public void Render(IRenderer renderer)
 {
     foreach (var position in this.elements)
     {
         renderer.Render(position.x, position.y, 'o');
     }
 }
开发者ID:hristodobrev,项目名称:Software-University,代码行数:7,代码来源:Snake.cs

示例2: LetsPlay

 private static void LetsPlay(IRenderer _renderer, Game _game)
 {
     _renderer.Render();
     var turnMode = true;
     foreach (var gamePhase in _game.Turns())
     {
         switch (gamePhase)
         {
             case Game.EGamePhase.BOARD_PREPARE:
                 continue;
             case Game.EGamePhase.JUST_REDRAW:
                 _renderer.Render();
                 break;
             case Game.EGamePhase.TURN_DONE:
                 _renderer.Render();
                 break;
             default:
                 throw new ArgumentOutOfRangeException();
         }
     }
     Console.WriteLine(_game.Player + " gives up.");
 }
开发者ID:leandrolimasjrp,项目名称:my-project-hxapp,代码行数:22,代码来源:Program.cs

示例3: LoadFrontEnd

        private void LoadFrontEnd()
        {
			try //try to load a GUI as front-end
			{
                UimlDocument feUimlDoc = new UimlDocument(m_frontendFile);
				renderer =  (new BackendFactory()).CreateRenderer(feUimlDoc.Vocabulary);
                IRenderedInstance instance = renderer.Render(feUimlDoc);
                ExternalLibraries.Instance.Add(m_frontendLib);
				feUimlDoc.Connect(this);
                // add to the list
                renderedUIs.Add(m_frontendFile, instance);
                instance.ShowIt();
			}
			catch(Exception e)
			{
				//no interface available, use command-line options!
				throw new NoGuiAvailableException(e);
			}
		}
开发者ID:jozilla,项目名称:Uiml.net,代码行数:19,代码来源:UimlFrontEnd.cs

示例4: CheckAllGeneratedTriplets

        private static void CheckAllGeneratedTriplets(IRenderer _renderer, Board _board)
        {
            foreach (var triplet in _board.Triplets)
            {
                foreach (var cell in _board.Cells)
                {
                    cell.Clear();
                }

                triplet.Cells[0].Value = 3;
                triplet.Cells[1].Value = 1;
                triplet.Cells[2].Value = 1;

                _renderer.Render();

                Console.WriteLine("Triplet: " + triplet);
                Console.ReadKey(true);
            }
        }
开发者ID:leandrolimasjrp,项目名称:my-project-hxapp,代码行数:19,代码来源:Program.cs

示例5: Init

        public static void Init(GlobalState state)
        {
            if (state != null) { 
                _state = state;
                BaseRenderer.UpdateState((BaseRenderer)BackgroundRenderer, state);
                BaseRenderer.UpdateState((BaseRenderer)MagicRenderer, state);
            }

            if (IsInitialized) return;

            _deviceManager1 = new CommonDX.DeviceManager();
            _deviceManager2 = new CommonDX.DeviceManager();

            _renderer1 = new DxRenderer.BackgroundComposer() { State = _state };
            _renderer2 = new DxRenderer.MagicComposer() { State = _state };


            BackgroundSIS = new SumoNinjaMonkey.Framework.Controls.DrawingSurfaceSIS(
                (gt) => { _renderer1.Update(gt); },
                (tb) => { _renderer1.Render(tb); },
                (dm) => { _renderer1.Initialize(dm); },
                (e1, e2) => { _renderer1.InitializeUI(e1, e2); },
                (uri) => { _renderer1.LoadLocalAsset(uri); },
                () => { _renderer1.Unload(); },
                _deviceManager1);
                //_renderer1, _deviceManager1);



            MagicSIS = new SumoNinjaMonkey.Framework.Controls.DrawingSurfaceSIS(
                (gt) => { _renderer2.Update(gt); },
                (tb) => { _renderer2.Render(tb); },
                (dm) => { _renderer2.Initialize(dm); },
                (e1, e2) => { _renderer2.InitializeUI(e1, e2); },
                (uri) => { _renderer2.LoadLocalAsset(uri); },
                () => { _renderer2.Unload(); },
                _deviceManager2);
                //_renderer2, _deviceManager2);


            IsInitialized = true;

        }
开发者ID:rolandsmeenk,项目名称:ModernApps,代码行数:43,代码来源:RenderingService.cs

示例6: RenderRelease

        private string RenderRelease(string key, string renderTo, IRenderer renderer)
        {
            if (!bundleCache.ContainsKey(key))
            {
                lock (bundleCache)
                {
                    if (!bundleCache.ContainsKey(key))
                    {
                        string compressedJavaScript;
                        string hash = null;
                        bool hashInFileName = false;

                        List<string> files = GetFiles(GetFilePaths(javaScriptFiles));
                        files.AddRange(GetFiles(GetEmbeddedResourcePaths(embeddedResourceJavaScriptFiles)));

                        if (renderTo.Contains("#"))
                        {
                            hashInFileName = true;
                            compressedJavaScript = MinifyJavaScript(files, javaScriptMinifier);
                            hash = hasher.GetHash(compressedJavaScript);
                            renderTo = renderTo.Replace("#", hash);
                        }

                        var outputFile = ResolveAppRelativePathToFileSystem(renderTo);

                        string minifiedJavaScript;
                        if (renderOnlyIfOutputFileMissing && FileExists(outputFile))
                        {
                            minifiedJavaScript = ReadFile(outputFile);
                        }
                        else
                        {
                            minifiedJavaScript = MinifyJavaScript(files, javaScriptMinifier);
                            renderer.Render(minifiedJavaScript, outputFile);
                        }

                        if (hash == null)
                        {
                            hash = hasher.GetHash(minifiedJavaScript);
                        }

                        string renderedScriptTag;
                        if (hashInFileName)
                        {
                            renderedScriptTag = FillTemplate(ExpandAppRelativePath(renderTo));
                        }
                        else
                        {
                            string path = ExpandAppRelativePath(renderTo);
                            if (path.Contains("?"))
                            {
                                renderedScriptTag = FillTemplate(ExpandAppRelativePath(renderTo) + "&r=" + hash);
                            }
                            else
                            {
                                renderedScriptTag = FillTemplate(ExpandAppRelativePath(renderTo) + "?r=" + hash);
                            }
                        }
                        renderedScriptTag = String.Concat(GetFilesForRemote(), renderedScriptTag);
                        bundleCache.AddToCache(key, renderedScriptTag, files);
                    }
                }
            }
            return bundleCache.GetContent(key);
        }
开发者ID:hbulhoes,项目名称:SquishIt,代码行数:65,代码来源:JavaScriptBundle.cs

示例7: Clear

 public void Clear(IRenderer renderer)
 {
     renderer.Render(this.elements.First().x, this.elements.First().y, ' ');
 }
开发者ID:hristodobrev,项目名称:Software-University,代码行数:4,代码来源:Snake.cs

示例8: RenderVideoUsingSplicer

 private static void RenderVideoUsingSplicer(IRenderer renderer)
 {
     try
       {
     Console.WriteLine("Beginning render");
     renderer.Render();
       }
       finally
       {
     var disposable = renderer as IDisposable;
     if (disposable != null) disposable.Dispose();
       }
 }
开发者ID:Supermortal,项目名称:MusicianHelper,代码行数:13,代码来源:Program.cs

示例9: RenderMapper

 private static bool RenderMapper(ReceiverList<IRenderer, int> list, IRenderer receiver, int parameter)
 {
     return receiver.Render(parameter);
 }
开发者ID:WinUP,项目名称:WADV,代码行数:4,代码来源:Receivers.cs

示例10: Write

        /// <summary> </summary>
        private void Write(ClassMapping classMapping, IDictionary class2classmap, IRenderer renderer,bool checkIfNewer)
        {
            string saveToPackage = renderer.GetSaveToPackage(classMapping);
            string saveToClassName = renderer.GetSaveToClassName(classMapping);
            FileInfo dir = this.GetDir(saveToPackage);
            StreamWriter writer = null;
            // a render implementing this interface can
            // decide a stream for output, so a directive in the
            // generation code can drive the output naming...
            ICanProvideStream streamProvider = renderer as ICanProvideStream;
            string fileName=null;
            bool performGeneration = true;
            try
            {
                if (null == streamProvider)
                {
                    fileName = Path.Combine(dir.FullName, this.GetFileName(saveToClassName));
                    FileInfo file = new FileInfo(fileName);
                    if (checkIfNewer)
                    {
                        FileInfo sourceFileinfo = SourceFileInfoMap.Instance.LookupByMapping(classMapping);
                        performGeneration = sourceFileinfo.LastWriteTimeUtc >= file.LastWriteTimeUtc;
                        if (false == performGeneration)
                            LogFileSkipped(sourceFileinfo, file);
                    }
                    if (performGeneration)
                    {
                        log.Debug("Writing " + file);
                        writer = new StreamWriter(new FileStream(file.FullName, FileMode.Create));
                    }
                }
                else
                {
                    if (performGeneration)
                    {
                        if (checkIfNewer)
                        {
                            FileInfo sourceFileinfo = SourceFileInfoMap.Instance.LookupByMapping(classMapping);
                            FileInfo target;
                            performGeneration = streamProvider.CheckIfSourceIsNewer(sourceFileinfo.LastWriteTimeUtc, dir.FullName, classMapping, out target);
                            if (false == performGeneration)
                                LogFileSkipped(sourceFileinfo, target);

                        }
                        if (performGeneration)
                            writer = new StreamWriter(streamProvider.GetStream(classMapping, dir.FullName, out fileName));
                        log.Debug("Renderer:" + renderer.GetType().Name + " provided a stream for output.");
                    }
                }

                if (performGeneration)
                {
                    renderer.Render(GetPackageName(saveToPackage), GetName(saveToClassName), classMapping, class2classmap, writer);
                    writer.Close();
                    if (null != fileObserver)
                    {
                        fileObserver.FileCreated(fileName);
                    }
                }
            }
            catch (Exception e)
            {
                log.Error("Error writing file:", e);
            }
        }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:66,代码来源:Generator.cs

示例11: Render

        protected void Render(IRenderer renderer, ITexture2D texture, AxisAlignedBoundingBox2D boundingBox)
        {
            if (!IsVisible) return;

            renderer.Render(texture, Transformation, boundingBox);
        }
开发者ID:TiagoJSM,项目名称:Storytime,代码行数:6,代码来源:TemplateRenderableAsset.cs

示例12: Render

 public virtual void Render(IRenderer renderer)
 {
     renderer.Render(this);
 }
开发者ID:K0bin,项目名称:Snake,代码行数:4,代码来源:Field.cs

示例13: Render

        public void Render(IRenderer renderer)
        {
            rasterizer.ClearImage((byte)' ', (byte)((Kernel32Console.DefaultColors.Foreground.BLACK << 4) | Kernel32Console.DefaultColors.Foreground.WHITE));

            rasterizer.DrawMeshFilled(transformation, meshes);//, Kernel32Console.DefaultColors.FOREGROUND_CYAN, Rasterizer.ShadePixelChar1);
            //rasterizer.DrawMeshVertices(transformation, meshes, Kernel32Console.DefaultColors.FOREGROUND_CYAN, (byte)'X');
            //rasterizer.DrawMeshWired(transformation, meshes, Kernel32Console.DefaultColors.Foreground.CYAN);

            //rasterizer.DrawMeshCenters(transformation, meshes, Kernel32Console.DefaultColors.Foreground.RED);
            //rasterizer.DrawMeshBoundingBox(transformation, meshes, Kernel32Console.DefaultColors.FOREGROUND_MAGENTA);

            //rasterizer.DrawAxes(Transformation.None, Kernel32Console.DefaultColors.Foreground.YELLOW);

            rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, Height / 2 - 2), string.Format("MODEL: '{0}'", currentWavefrontObjectFilePath));
            rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, Height / 2 - 3), string.Format("# POLYGONS: {0}", meshes.Sum(mesh => mesh.Faces.Count())));

            rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 10), string.Format("TRANSLATION: {0}", transformation.Translation));
            rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 9), string.Format("SCALE: {0}", transformation.Scale));
            rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 8), string.Format("ROTATION: {0}", transformation.Rotation));

            rasterizer.DrawStringHorizontal(Transformation.None, new Vector2(-Width / 2 + 1, 6), string.Format("MODEL CENTER: {0}", transformation.Transform(meshes.First().Centers.Value)));

            var rasterizedFrameBuffer = rasterizer.Rasterize();
            renderer.Render(rasterizedFrameBuffer);
        }
开发者ID:ckarcz,项目名称:GraphicsEngine,代码行数:25,代码来源:MeshTestScene.cs

示例14: Render

 protected virtual void Render(IRenderer renderer)
 {
     renderer.Render(this);
 }
开发者ID:jyunfan2015,项目名称:Calcifer,代码行数:4,代码来源:UIElement.cs

示例15: Draw

 public void Draw(IRenderer render, IDrawingContext context)
 {
     render.Render(context, this);
 }
开发者ID:Alex223124,项目名称:High-Quality-Code,代码行数:4,代码来源:Rectangle.cs


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