zoukankan      html  css  js  c++  java
  • MCPD 70536题目 自定义打印参数

    Question

    You are developing a custom event handler to automatically print all open documents. The event handler helps specify the number of copies to be printed. You need to develop a custom event arguments class to pass as a parameter to the event handler.

    Which code segment should you use?

    翻译:

      你正在开发自动打印所有打开文档的自定义事件程序。事件提供指定打印份数的数量。你需要开发一个自定义事件参数类传递参数给事件。你会用哪段代码?

    自己分析:

      1、自定义事件参数必须继续自EventArgs

      2、必须可以传递打印份数

      BD 首先被选出。在没有对打印份数赋值和取值。所有选B

      答案例子参考:C# 自定义事件并使用自定义事件参数方法

    A:
    public class PrintingArgs 
    {
      
    private int copies;
      
    public PrintingArgs(int numberOfCopies) 
      {
        
    this.copies = numberOfCopies;
      }
      
    public int Copies 
      {
        
    get { return this.copies; }
      }
    }


    B:

    public class PrintingArgs : EventArgs 
    {
      
    private int copies;
      
    public PrintingArgs(int numberOfCopies) 
      {
        
    this.copies = numberOfCopies;
      }
      
    public int Copies 
      {
        
    get { return this.copies; }
      }
    }


    C:

    public class PrintingArgs 
    {
      
    private EventArgs eventArgs;
      
    public PrintingArgs(EventArgs ea) 
      {
        
    this.eventArgs = ea;
      }
      
    public EventArgs Args 
      { 
      
    get { return eventArgs; }
      }
    }


    D: 

    public class PrintingArgs : EventArgs 
    {  
    private int copies; 
    }


  • 相关阅读:
    [TJOI2013]单词
    [AHOI2005]病毒检测
    [SCOI2016]围棋
    [SDOI2008]Sandy的卡片
    [POI2005]Sza-Template
    [Usaco2015 Feb]Censoring
    浅谈算法——KMP
    yii2邮件配置教程,报Expected response code 250 but got code "553"原因
    yii2设置发送邮件的一些配置
    js 的正则表达式 部分展示test()方法的验证功能
  • 原文地址:https://www.cnblogs.com/scottckt/p/1838623.html
Copyright © 2011-2022 走看看