• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDisplay类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Register

        public Register(IBasket basket, IDisplay display, IScanner scanner)
        {
            logger = LoggerFactory.GetLogger();

            this.basket = basket;
            this.display = display;
            this.scanner = scanner;

            basket.OnAdd += display.AddProduct;
            basket.AddSuccess += scanner.FlashLed;
            basket.AddFail += scanner.FlashLed;
            basket.OnUpdate += display.UpdateProduct;
            basket.OnRemove += display.RemoveProduct;
            basket.OnUpdateTotalCost += display.UpdateTotalCost;
            basket.OnUpdateProductCount += display.UpdateProductCount;

            display.OnStartScan += scanner.Start;
            display.OnStopScan += scanner.Stop;
            display.OnClear += basket.Clear;

            scanner.OnRead += new OnReadHandler(scanner_OnRead);

            logger.Write("Register", LogLevel.INFO, "Register initialized");

            display.Display();
        }
开发者ID:wytsevisser,项目名称:wvt,代码行数:26,代码来源:Register.cs


示例2: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            // Clean up previous contents
            clearFormControls();

            // Determine which species the user wants (see code below)
            String speciesName = getCheckedSpecies();

            // Get a List of the relevant Critters from the catalogue
            // YOU WILL NEED TO WRITE THE CRITTERQUERY METHOD
            List<Critter> selectedCritters = mainCatalogue.CritterQuery(speciesName);
            int critterCount = selectedCritters.Count;

            if (critterCount == 0)
            {
                MessageBox.Show("No critters of that species");
            }
            else
            {
                if (critterCount > pictureBoxList.Count)
                    displayMachine = textDisplayMachine;    // Will show images
                else
                    displayMachine = pictureDisplayMachine; // Will print text

                // clear any old contents. Part of IDisplay, so the Form knows it will work
                displayMachine.clearDisplay();

                // Make the call here. Behaviour will depend on which strategy your
                // instance implements.
                displayMachine.displayCritterList(selectedCritters);
            }
        }
开发者ID:paddymoran,项目名称:IN710morapd1,代码行数:32,代码来源:Form1.cs


示例3: DoWork

 public void DoWork(Card[] cards, ITrello trello, IDisplay display)
 {
     foreach (var card in cards.Select(x => new ReleaseNotesCard(x)))
     {
         display.Write(string.Format("{0} - {1}", card.Labels, card.Name));
     }
 }
开发者ID:craignicol,项目名称:trello-release-notes,代码行数:7,代码来源:ConsoleDump.cs


示例4: DrawEditSymbol

        public void DrawEditSymbol(IGeometry geometry, IDisplay display)
        {
            IEngineEditProperties engineProperty = new EngineEditorClass();

            ISymbol pointSymbol = engineProperty.SketchVertexSymbol as ISymbol;
            ISymbol sketchSymbol = engineProperty.SketchSymbol as ISymbol;

            ITopologicalOperator pTopo = geometry as ITopologicalOperator;

            sketchSymbol.SetupDC(display.hDC, display.DisplayTransformation);
            sketchSymbol.Draw(pTopo.Boundary);

            IPointCollection pointCol = geometry as IPointCollection;
            for (int i = 0; i < pointCol.PointCount; i++)
            {
                IPoint point = pointCol.get_Point(i);
                pointSymbol.SetupDC(display.hDC, display.DisplayTransformation);
                pointSymbol.Draw(point);
                pointSymbol.ResetDC();
            }

            ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(sketchSymbol);
            ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(pointSymbol);
            ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(engineProperty);
        }
开发者ID:chinasio,项目名称:minegis,代码行数:25,代码来源:AoEditor.cs


示例5: BorrowController

        public BorrowController(IDisplay display, ICardReader reader, IScanner scanner, IPrinter printer,
                                    IBookDAO bookDAO, ILoanDAO loanDAO, IMemberDAO memberDAO)
        {
            if(display == null) throw new ArgumentException("Display object was not provided to begin the application");
            if (reader == null) throw new ArgumentException("Reader object was not provided to begin the application");
            if (scanner == null) throw new ArgumentException("Scanner object was not provided to begin the application");
            if (printer == null) throw new ArgumentException("Printer object was not provided to begin the application");
            if (bookDAO == null) throw new ArgumentException("BookDAO object was not provided to begin the application");
            if (loanDAO == null) throw new ArgumentException("LoanDAO object was not provided to begin the application");
            if (memberDAO == null) throw new ArgumentException("MemberDAO object was not provided to begin the application");

            _display = display;
            _reader = reader;
            _scanner = scanner;
            _printer = printer;

            _bookDAO = bookDAO;
            _loanDAO = loanDAO;
            _memberDAO = memberDAO;

            _ui = new BorrowControl(this);

            _reader.Listener = this;
            _scanner.Listener = this;

            _bookList = new List<IBook>();
            _loanList = new List<ILoan>();

            _state = EBorrowState.CREATED;
        }
开发者ID:andrewtobin,项目名称:NewLibrary_CSharp,代码行数:30,代码来源:BorrowController.cs


示例6: render

 public void render(IDisplay display)
 {
     this.display = display;
     display.imageBegin(imageWidth, imageHeight, 32);
     // set members variables
     bucketCounter = 0;
     // start task
     SunflowSharp.Systems.Timer timer = new SunflowSharp.Systems.Timer();
     timer.start();
     BucketThread[] renderThreads = new BucketThread[scene.getThreads()];
     for (int i = 0; i < renderThreads.Length; i++)
     {
         renderThreads[i] = new BucketThread(this);
         renderThreads[i].setPriority(scene.getThreadPriority());
         renderThreads[i].start();
     }
     for (int i = 0; i < renderThreads.Length; i++)
     {
         try
         {
             renderThreads[i].join();
         }
         catch (Exception e)
         {
             UI.printError(UI.Module.BCKT, "Bucket processing thread {0} of {1} was interrupted", i + 1, renderThreads.Length);
         }
     }
     timer.end();
     UI.printInfo(UI.Module.BCKT, "Render time: {0}", timer.ToString());
     display.imageEnd();
 }
开发者ID:rzel,项目名称:sunflowsharp,代码行数:31,代码来源:SimpleRenderer.cs


示例7: DisplayHandler

 public DisplayHandler(IDisplay _display)
 {
   this.display = _display;
   this.heightInChars = Settings.Instance.TextHeight;
   if (this.heightInChars == 1)
   {
     this.heightInCharsSim = 2;
   }
   else
   {
     this.heightInCharsSim = this.heightInChars;
   }
   this.widthInChars = Settings.Instance.TextWidth;
   this.pixelsToScroll = Settings.Instance.PixelsToScroll;
   this.widthInPixels = Settings.Instance.GraphicWidth;
   this.heightInPixels = Settings.Instance.GraphicHeight;
   this.charsToScroll = Settings.Instance.CharsToScroll;
   this.forceGraphicText = Settings.Instance.ForceGraphicText;
   this.lines = new Line[this.heightInCharsSim];
   this.prevLines = new string[this.heightInChars];
   this.posSkips = new int[this.heightInChars];
   this.pos = new int[this.heightInChars];
   font = new Font(Settings.Instance.Font, (float)Settings.Instance.FontSize);
   for (int i = 0; i < this.heightInCharsSim; i++)
   {
     this.lines[i] = new Line();
   }
   for (int i = 0; i < this.heightInChars; i++)
   {
     this.pos[i] = 0;
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:32,代码来源:DisplayHandler.cs


示例8: AbsoluteLayoutWithDisplayInfoPage

		/// <summary>
		/// Initializes a new instance of the <see cref="AbsoluteLayoutWithDisplayInfoPage" /> class.
		/// </summary>
		/// <param name="display">The display.</param>
		public AbsoluteLayoutWithDisplayInfoPage(IDisplay display)
		{
			this.Title = "Absolute Layout With Display Info";
			var abs = new AbsoluteLayout();
			var inchX = display.WidthRequestInInches(1);
			var inchY = display.HeightRequestInInches(1);
			var originX = display.WidthRequestInInches(display.ScreenWidthInches() / 2);
			var originY = display.HeightRequestInInches(display.ScreenHeightInches() / 2);

			abs.Children.Add(new Label() { Text = "1\"x\"1\" blue frame" });

			abs.Children.Add(new Frame()
				{
					BackgroundColor = Color.Navy,
				},
				new Rectangle(originX - inchX/2, originY - inchY/2, inchX, inchY));

			abs.Children.Add(new Frame()
				{
					BackgroundColor = Color.White
				},
				new Rectangle(originX - inchX/16, originY - inchY/16, inchX/8, inchY/8));

			this.Content = abs;
		}
开发者ID:jdluzen,项目名称:Xamarin-Forms-Labs,代码行数:29,代码来源:AbsoluteLayoutWithDisplayInfoPage.cs


示例9: RenderInfinite

        private string RenderInfinite(string content, IDisplay display)
        {
            // append " - "
            content += " - ";

            // update scroll position
            if (_scrollDirection != 0 && _lastPositionChange.Add(Speed) < DateTime.Now)
            {
                _position++;

                // reset position at end and pause
                if (_position >= content.Length)
                {
                    _position = 0;
                    _scrollDirection = 0;
                }

                _lastPositionChange = DateTime.Now;
            }

            // start again after pause
            if (_scrollDirection == 0 && _lastPositionChange.Add(Pause) < DateTime.Now)
            {
                _scrollDirection = 1;
            }

            var partLength = (content.Length - _position > display.Columns 
                ? display.Columns 
                : content.Length - _position);

            return content.Substring(_position, partLength) + content.Substring(0, display.Columns - partLength);
        }
开发者ID:mwinkler,项目名称:RaspberryPi.Musicbox,代码行数:32,代码来源:ScrollRenderer.cs


示例10: SolveRun

 public SolveRun(ICubeConfigurationGenerator generator, ISolver solver, IDisplay display, ICelebrator celebrator, int cubeSize)
 {
     m_display = display;
     m_celebrator = celebrator;
     m_solver = solver;
     m_generator = generator;
     m_cubeSize = cubeSize;
 }
开发者ID:EdwardSalter,项目名称:NCubeSolver,代码行数:8,代码来源:SolveRun.cs


示例11: ChatUser

        public ChatUser(string username, IDisplay display)
        {
            if (username == null) 
                throw new Exception("Username is null");
            Username = username;

            Display = display;
        }
开发者ID:martis347,项目名称:MessengerProject.Host,代码行数:8,代码来源:ChatUser.cs


示例12: CPU

        public CPU(Memory memory, IDisplay display, IKeyboard keyboard)
        {
            this.memory = memory;
            this.display = display;
            this.keyboard = keyboard;
            this.DelayTimer = new SimpleTimer();
            this.SoundTimer = new SimpleTimer();

            this.RandomFunc = this.RandomGenerator;

            InstructionSet[0x0] = SYS;
            InstructionSet[0x1] = JP;
            InstructionSet[0x2] = CALL;
            InstructionSet[0x3] = SE;
            InstructionSet[0x4] = SNE;
            InstructionSet[0x5] = SEV;
            InstructionSet[0x6] = LD;
            InstructionSet[0x7] = ADD;
            InstructionSet[0x8] = REG;
            InstructionSet[0x9] = SNEV;
            InstructionSet[0xA] = LDI;
            InstructionSet[0xB] = JPV;
            InstructionSet[0xC] = RND;
            InstructionSet[0xD] = DRW;
            InstructionSet[0xE] = SKP;
            InstructionSet[0xF] = LDS;

            // used with REG
            RegisterCommands[0x0] = (x, y) => Register[x] = Register[y];
            RegisterCommands[0x1] = (x, y) => Register[x] |= Register[y];
            RegisterCommands[0x2] = (x, y) => Register[x] &= Register[y];
            RegisterCommands[0x3] = (x, y) => Register[x] ^= Register[y];
            RegisterCommands[0x4] = (x, y) =>
                {
                    Register[0xf] = (byte)((Register[x] + Register[y]) > 0xff ? 1 : 0);
                    Register[x] += Register[y];
                };
            RegisterCommands[0x5] = (x, y) =>
                                        {
                                            Register[0xf] = (byte) (Register[x] > Register[y] ? 1 : 0);
                                            Register[x] -= Register[y];
                                        };
            RegisterCommands[0x6] = (x, y) =>
                                        {
                                            Register[0xf] = (byte) (Register[x] & 0x1);
                                            Register[x] = (byte) (Register[x] >> 1);
                                        };
            RegisterCommands[0x7] = (x, y) =>
            {
                Register[0xf] = (byte)(Register[x] < Register[y] ? 1 : 0);
                Register[x] = (byte) (Register[y] - Register[x]);
            };
            RegisterCommands[0xe] = (x, y) =>
            {
                Register[0xf] = (byte)(Register[x] >> 7);
                Register[x] = (byte)(Register[x] << 1);
            };
        }
开发者ID:perfp,项目名称:Chip8,代码行数:58,代码来源:CPU.cs


示例13: CoinChanger

        public CoinChanger(IDisplay d, CoinStorage changeBox)
        {
            brain = new CircuitBoard();
            coinID = new CoinIdentify();
            storage = new CoinStorage();

            display = d;
            returnChange = changeBox;
        }
开发者ID:LoOnyBiker,项目名称:VendingMachineEmulator,代码行数:9,代码来源:CoinChanger.cs


示例14: BorrowControlTests

 public BorrowControlTests()
 {
     _display = Substitute.For<IDisplay>();
     _reader = Substitute.For<ICardReader>();
     _scanner = Substitute.For<IScanner>();
     _printer = Substitute.For<IPrinter>();
     _bookDao = Substitute.For<IBookDAO>();
     _loanDao = Substitute.For<ILoanDAO>();
     _memberDao = Substitute.For<IMemberDAO>();
 }
开发者ID:andrewtobin,项目名称:NewLibrary_CSharp,代码行数:10,代码来源:BorrowControlTests.cs


示例15: DoWork

        public void DoWork(Card[] cards, ITrello trello, IDisplay display)
        {
            display.Skip();
            display.Write("Archiving cards...");

            foreach (var card in cards)
            {
                trello.Cards.Archive(card);
            }
        }
开发者ID:craignicol,项目名称:trello-release-notes,代码行数:10,代码来源:Archive.cs


示例16: FontManagerPage

        /// <summary>
        /// Initializes a new instance of the <see cref="FontManagerPage"/> class.
        /// </summary>
        /// <param name="display">The display.</param>
        /// <param name="fontManager">The font manager.</param>
        public FontManagerPage(IDisplay display, IFontManager fontManager)
        {
            var stack = new StackLayout();

            foreach (var namedSize in Enum.GetValues(typeof(NamedSize)))
            {
                var font = Font.SystemFontOfSize((NamedSize)namedSize);

                var height = fontManager.GetHeight(font);

                var heightRequest = display.HeightRequestInInches(height);

                var label = new Label()
                {
                    Font = font,
                    HeightRequest = heightRequest + 10,
                    Text = string.Format("System font {0} is {1:0.000}in tall.", namedSize, height),
                    XAlign = TextAlignment.Center
                };

                stack.Children.Add(label);
            }

            var f = Font.SystemFontOfSize(24);

            var inchFont = fontManager.FindClosest(f.FontFamily, fontSize);

            stack.Children.Add(new Label()
            {
                Text = "The below text should be " + fontSize + "in height from its highest point to lowest.",
                XAlign = TextAlignment.Center
            });


            stack.Children.Add(new Label()
            {
                Text = "FfTtLlGgJjPp",
                TextColor = Color.Lime,
                FontSize = inchFont.FontSize,
//                BackgroundColor = Color.Gray,
//                FontFamily = inchFont.FontFamily,
                XAlign = TextAlignment.Center,
                YAlign = TextAlignment.Start
            });


            stack.Children.Add(new Label()
            {
                Text = fontSize + "in height = SystemFontOfSize(" + inchFont.FontSize + ")",
                XAlign = TextAlignment.Center,
                YAlign = TextAlignment.End
            });

            this.Content = stack;
        }
开发者ID:nrogoff,项目名称:Xamarin-Forms-Labs,代码行数:60,代码来源:FontManagerPage.cs


示例17: Run

 public void Run(IGraph g, IDisplay d)
 {
     IVertex v = g.vertexes()[0];
     v.setMark (true);
     foreach (IEdge e in v.edges()) {
         e.setMark (true);
         e.vto().setMark (true);
         d.update();
     }
     System.Console.WriteLine ("I am ok!");
 }
开发者ID:dmatveev,项目名称:graphite,代码行数:11,代码来源:sample.cs


示例18: DoWork

        public void DoWork(Card[] cards, ITrello trello, IDisplay display)
        {
            var cardsGroupedByLabel = cards
                                        .Select(x => new ReleaseNotesCard(x))
                                        .GroupBy(x => x.Labels)
                                        .ToArray();

            File.WriteAllText(_options.Output,
                              Razor.Parse(File.ReadAllText(_options.Template),
                                          new { _options.SoftwareName, _options.SoftwareVersion, Groups = cardsGroupedByLabel }));
        }
开发者ID:craignicol,项目名称:trello-release-notes,代码行数:11,代码来源:ReleaseNotes.cs


示例19: Chip8Cpu

        public Chip8Cpu(IDisplay display, IRandomizer randomizer, IKeyboard keyboard, IBcdConverter bcdConverter, IInstructionDecoder instructionDecoder, ITimerClock timerClock)
        {
            _display = display;
            _randomizer = randomizer;
            _keyboard = keyboard;
            _bcdConverter = bcdConverter;
            _instructionDecoder = instructionDecoder;
            _timerClock = timerClock;

            State = new CpuState();
        }
开发者ID:ChrisJansson,项目名称:chip8,代码行数:11,代码来源:Chip8Cpu.cs


示例20: Context

            protected override void Context()
            {
                base.Context();

                Display = A.Fake<IDisplay>();
                InputMonitor = A.Fake<IInputMonitor>();
                Calculator = A.Fake<IStringCalculator>();

                Sut = new Program(Display, InputMonitor, Calculator);
                Sut.Initialize();
            }
开发者ID:caloggins,项目名称:NhibSamples,代码行数:11,代码来源:ProgramTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDisposable类代码示例发布时间:2022-05-24
下一篇:
C# IDispatcher类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap