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


C# EventHandler类代码示例

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


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

示例1: GameScreen

        /// <summary>
        /// Create a new game screen. Should be done every time there is a new game.
        /// </summary>
        /// <param name="theScreenEvent"></param>
        /// <param name="contentManager"></param>
        public GameScreen(EventHandler theScreenEvent,ContentManager contentManager)
            : base(theScreenEvent)
        {
            bScoreWasAdded = false;

            this.contentManager = contentManager;
            dlDoubleJumpTimer = new DanLabel(1150, 20, 100, 50);

            //Init our intrepid hero
            csHero = new ControlledSprite();

            bg = new LayeredBackground();

            djeJumpEffect = new DoubleJumpEffect();

            altimeter = new Altimeter(); // Make a camera for the screen with an altimeter
            cCamera = new Camera(50, 100, 600, 520, altimeter);

            blocks = new List<Sprite>();
            Sprite sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);
            sp = new Sprite();
            blocks.Add(sp);

            // REVIST Set up the Arcing Block Manager with the difficulty
            arcingBlockManager = new ArcingBlockManager(cCamera, blocks, contentManager, 500, 300, 150, "Sprites/block2");
        }
开发者ID:Shnagenburg,项目名称:ClimbGame,代码行数:38,代码来源:GameScreen.cs

示例2: CusCtlTellPanelChar

 public CusCtlTellPanelChar(Liplis.MainSystem.Liplis lips, ObjSetting os, string url, string title, string discription, int newsEmotion, int newsPoint, Bitmap charBody, EventHandler enter, IContainer components)
 {
     this.lips = lips;
     this.os = os;
     initCms(components);
     initDataPanelNonThum(url, title, discription, newsEmotion, newsPoint, charBody, enter);
 }
开发者ID:LipliStyle,项目名称:LiplisDoll,代码行数:7,代码来源:CusCtlTellPanelChar.cs

示例3: IntWithRandom

        public IntWithRandom()
        {
            InitializeComponent();

            if (Core.Language == Language.English)
            {
                drawnas_1.Text = "Range";
                drawnas_2.Text = "Gauss";
            }

            EnableUndo = true;

            this.SuspendLayout();
            Anchor = AnchorStyles.Left | AnchorStyles.Right;
            this.ResumeLayout(false);

            Reading = false;
            Writing = false;

            Reading = true;
            Read();
            Reading = false;

            HandleDestroyed += new EventHandler(IntWithRandom_HandleDestroyed);
        }
开发者ID:AraiYuhki,项目名称:Effekseer,代码行数:25,代码来源:IntWithRandom.cs

示例4: HtmlToClrEventProxy

        public HtmlToClrEventProxy(object sender, string eventName, EventHandler eventHandler) {
            this.eventHandler = eventHandler;
            this.eventName = eventName;

            Type htmlToClrEventProxyType = typeof(HtmlToClrEventProxy);
            typeIReflectImplementation = htmlToClrEventProxyType as IReflect;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:HtmlToClrEventProxy.cs

示例5: CanExecuteChangedTest

        public void CanExecuteChangedTest()
        {
            var command = new RelayCommand(() =>
            {
            },
                                           () => true);

            var canExecuteChangedCalled = 0;

            var canExecuteChangedEventHandler = new EventHandler((s, e) => canExecuteChangedCalled++);

            command.CanExecuteChanged += canExecuteChangedEventHandler;

            command.RaiseCanExecuteChanged(true);

#if SILVERLIGHT
            Assert.AreEqual(1, canExecuteChangedCalled);
#else
            // In WPF, cannot trigger the CanExecuteChanged event like this
            Assert.AreEqual(0, canExecuteChangedCalled);
#endif

            command.CanExecuteChanged -= canExecuteChangedEventHandler;
            command.RaiseCanExecuteChanged(true);

#if SILVERLIGHT
            Assert.AreEqual(1, canExecuteChangedCalled);
#else
            // In WPF, cannot trigger the CanExecuteChanged event like this
            Assert.AreEqual(0, canExecuteChangedCalled);
#endif
        }
开发者ID:ssickles,项目名称:archive,代码行数:32,代码来源:RelayCommandTest.cs

示例6: UICommand

        public UICommand(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
            ClickForwarderDelegate = new EventHandler(ClickForwarder);
        }
开发者ID:Stoner19,项目名称:Memory-Lifter,代码行数:7,代码来源:UICommand.cs

示例7: toolStripButton1_Click

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            try
            {
                _nombreDocumento = this.toolStripTextBox1.Text;
                //leemos el documento
                _procesador = new XBRLProcesadorProveedor(new Uri(_nombreDocumento));
                //le decimos al componente que tenemos las clases generadas
                _procesador.OptimizarEnsamblado(System.Reflection.Assembly.GetExecutingAssembly());
                //procesamos el documento
                _procesador.Procesar();
                //obtenemos las instancias
                IXBRLContenedorInstanciasObjetos contenedor = _procesador.ContenedorInstanciasConceptos;

                this.conceptosMenu.DropDownItems.Clear();
                //obtenemos los conceptos existentes en las instancias
                foreach (string nombreConcepto in contenedor.Conceptos)
                {
                    //por cada concepto creamos un submenu
                    EventHandler manejadorEvento = new EventHandler(pulsameToolStripMenuItem_Click);
                    this.conceptosMenu.DropDownItems.Add(nombreConcepto, null, manejadorEvento);
                }
            }
            catch { }
        }
开发者ID:mondedos,项目名称:dotxbrl,代码行数:25,代码来源:Form1.cs

示例8: MainForm

	public MainForm ()
	{
		_checkedListBox = new CheckedListBox ();
		_checkedListBox.Dock = DockStyle.Top;
		_checkedListBox.Font = new Font (_checkedListBox.Font.FontFamily, _checkedListBox.Font.Height + 8);
		_checkedListBox.Height = 120;
		Controls.Add (_checkedListBox);
		// 
		// _threeDCheckBox
		// 
		_threeDCheckBox = new CheckBox ();
		_threeDCheckBox.Checked = _checkedListBox.ThreeDCheckBoxes;
		_threeDCheckBox.FlatStyle = FlatStyle.Flat;
		_threeDCheckBox.Location = new Point (8, 125);
		_threeDCheckBox.Text = "3D checkboxes";
		_threeDCheckBox.CheckedChanged += new EventHandler (ThreeDCheckBox_CheckedChanged);
		Controls.Add (_threeDCheckBox);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 150);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82100";
		Load += new EventHandler (MainForm_Load);
	}
开发者ID:mono,项目名称:gert,代码行数:26,代码来源:MainForm.cs

示例9: RegisterCommand

 private void RegisterCommand(ToolbarCommand id, EventHandler callback)
 {
     var menuCommandID = new CommandID(PackageConstants.GuidTortoiseGitToolbarCmdSet, (int)id);
     var menuItem = new OleMenuCommand(callback, menuCommandID);
     menuItem.Visible = false;
     _commandService.AddCommand(menuItem);
 }
开发者ID:duncansmart,项目名称:TortoiseGitToolbar,代码行数:7,代码来源:TortoiseGitToolbarPackage.cs

示例10: EventLoop

 /// <summary>
 ///		Initialize new instance.
 /// </summary>
 /// <param name="errorHandler">
 ///		Initial event handler of <see cref="TransportError"/>. This handler may be null.
 /// </param>
 protected EventLoop( EventHandler<RpcTransportErrorEventArgs> errorHandler )
 {
     if ( errorHandler != null )
     {
         this.TransportError += errorHandler;
     }
 }
开发者ID:yfakariya,项目名称:msgpack-rpc,代码行数:13,代码来源:EventLoop.cs

示例11: AttachEssentailHandlers

 public void AttachEssentailHandlers(
     EventHandler<ImageRequestEventArgs> reqImageHandler,
     EventHandler<TextRequestEventArgs> reqStyleSheetHandler)
 {
     this.requestImage = reqImageHandler;
     this.requestStyleSheet = reqStyleSheetHandler;
 }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:7,代码来源:HtmlHost.cs

示例12: CodeEditBox

        public CodeEditBox()
        {
            this.LoadDefaultProperties();
            InitializeComponent();

            textChanged = new EventHandler<TextChangedEventArgs>(OnTextChanged);
            rowsChanged = new EventHandler(OnRowsChanged);

            autoCompiler.GotFocus += (s, e) => { Focus(); };
            autoCompiler.MouseDown += AutoCompiler_MouseDown;
            autoCompiler.Visible = false;

            SetStyle(ControlStyles.Selectable, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            PropertyJoin.ChangedPropertyEvent(this, new string[] {
                "SyntaxHighlighter",
                "CommentChar",
                "PrefixChar"
            }, UpdateSyntax);

            AddRow(new Row(this));
            ClearHistory();
            Zoom = 1;
        }
开发者ID:Xambey,项目名称:MAIDE,代码行数:27,代码来源:CodeEditBox.cs

示例13: clsButton

        private Texture2D texturaSelecionado; //  botão em estado selecionado

        #endregion Fields

        #region Constructors

        public clsButton(Game game, Texture2D TexturaNaoSelecionado, Texture2D TexturaSelecionado, Vector2 Posicao, EventHandler evento)
        {
            texturaNaoSelecionado = TexturaNaoSelecionado;
            texturaSelecionado = TexturaSelecionado;
            posicao = Posicao;
            eventoClick = evento;
        }
开发者ID:BigDogsGames,项目名称:XNA-TrabM2,代码行数:13,代码来源:clsButton.cs

示例14: InteractiveEvaluator

        internal InteractiveEvaluator(
            IContentType contentType,
            HostServices hostServices,
            IViewClassifierAggregatorService classifierAggregator,
            IInteractiveWindowCommandsFactory commandsFactory,
            ImmutableArray<IInteractiveWindowCommand> commands,
            string responseFilePath,
            string initialWorkingDirectory,
            string interactiveHostPath,
            Type replType)
        {
            Debug.Assert(responseFilePath == null || PathUtilities.IsAbsolute(responseFilePath));

            _contentType = contentType;
            _responseFilePath = responseFilePath;
            _workspace = new InteractiveWorkspace(this, hostServices);
            _contentTypeChangedHandler = new EventHandler<ContentTypeChangedEventArgs>(LanguageBufferContentTypeChanged);
            _classifierAggregator = classifierAggregator;
            _initialWorkingDirectory = initialWorkingDirectory;
            _commandsFactory = commandsFactory;
            _commands = commands;

            var hostPath = interactiveHostPath;
            _interactiveHost = new InteractiveHost(replType, hostPath, initialWorkingDirectory);
            _interactiveHost.ProcessStarting += ProcessStarting;
        }
开发者ID:nevinclement,项目名称:roslyn,代码行数:26,代码来源:InteractiveEvaluator.cs

示例15: MainPage

 public MainPage()
 {
     this.Unloaded += new RoutedEventHandler(MainPage_Unloaded);
     BindingValidationError += new EventHandler<ValidationErrorEventArgs>(MainPage_BindingValidationError);
     // Required to initialize variables
     InitializeComponent();
 }
开发者ID:densem-2013,项目名称:RssWCF,代码行数:7,代码来源:MainPage.xaml.cs


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