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

C# EventHandler类代码示例

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

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



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


示例16: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            Reporter = this;

            TestingElement.BubblingTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.BubblingTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;
            TestingElement.TunnelingTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.TunnelingTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;
            TestingElement.ChildrenTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.ChildrenTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;
            TestingElement.DescendentsTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.DescendentsTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;
            TestingElement.ParentTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.ParentTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;
            TestingElement.SiblingsTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.SiblingsTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;
            TestingElement.SpreadTestEvent.GetEventTracer().EventRaising += EventTracer_EventRaising;
            TestingElement.SpreadTestEvent.GetEventTracer().EventRaised += EventTracer_EventRaised;

            InitElementOwnerTable();
            InitElements();

            //Location and Size
            Left = Properties.Settings.Default.X;
            Top = Properties.Settings.Default.Y;

            LocationChanged += new EventHandler(MainWindow_LocationChanged);
        }
开发者ID:pedone,项目名称:DecisionTableAnalizer,代码行数:30,代码来源:MainWindow.xaml.cs


示例17: ToggleFindToolBar

        internal static void ToggleFindToolBar(Decorator findToolBarHost, EventHandler handlerFindClicked, bool enable)
        {
            if (enable)
            {
                // Create FindToolBar and attach it to the host.
                FindToolBar findToolBar = new FindToolBar();
                findToolBarHost.Child = findToolBar;
                findToolBarHost.Visibility = Visibility.Visible;
                KeyboardNavigation.SetTabNavigation(findToolBarHost, KeyboardNavigationMode.Continue);
                FocusManager.SetIsFocusScope(findToolBarHost, true);

                // Initialize FindToolBar
                findToolBar.SetResourceReference(Control.StyleProperty, FindToolBarStyleKey);
                findToolBar.FindClicked += handlerFindClicked;
                findToolBar.DocumentLoaded = true;
                findToolBar.GoToTextBox();
            }
            else
            {
                // Reset FindToolBar state to its initial state.
                FindToolBar findToolBar = findToolBarHost.Child as FindToolBar;
                findToolBar.FindClicked -= handlerFindClicked;
                findToolBar.DocumentLoaded = false;

                // Remov FindToolBar form its host.
                findToolBarHost.Child = null;
                findToolBarHost.Visibility = Visibility.Collapsed;
                KeyboardNavigation.SetTabNavigation(findToolBarHost, KeyboardNavigationMode.None);
                findToolBarHost.ClearValue(FocusManager.IsFocusScopeProperty);
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:31,代码来源:DocumentViewerHelper.cs


示例18: Label

		public Label () :base ()
		{
			// Defaults in the Spec
			autosize = false;
			TabStop = false;
			string_format = new StringFormat();
			string_format.FormatFlags = StringFormatFlags.LineLimit;
			TextAlign = ContentAlignment.TopLeft;
			image = null;
			UseMnemonic = true;
			image_list = null;
			image_align = ContentAlignment.MiddleCenter;
			SetUseMnemonic (UseMnemonic);
			flat_style = FlatStyle.Standard;

			SetStyle (ControlStyles.Selectable, false);
			SetStyle (ControlStyles.ResizeRedraw | 
				ControlStyles.UserPaint | 
				ControlStyles.AllPaintingInWmPaint |
				ControlStyles.SupportsTransparentBackColor
				| ControlStyles.OptimizedDoubleBuffer
				, true);
			
			HandleCreated += new EventHandler (OnHandleCreatedLB);
		}
开发者ID:mcneel,项目名称:MonoMac.Windows.Form,代码行数:25,代码来源:Label.cocoa.cs


示例19: SnapToPixelsImage

        public SnapToPixelsImage()
        {
            _sourceDownloaded = new EventHandler(OnSourceDownloaded);
            _sourceFailed = new EventHandler<ExceptionEventArgs>(OnSourceFailed);

            LayoutUpdated += new EventHandler(OnLayoutUpdated);
        }
开发者ID:daspilker,项目名称:dasbackuptool,代码行数:7,代码来源:SnapToPixelsImage.cs


示例20: AnnoToolsForm

 public AnnoToolsForm()
 {
     InitializeComponent();
     LocalizeUI();
     MouseMode();
     Disposed += new EventHandler(FloatingToolsForm_Disposed);
 }
开发者ID:djpnewton,项目名称:ddraw,代码行数:7,代码来源:AnnoToolsForm.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# EventInfo类代码示例发布时间:2022-05-24
下一篇:
C# EventDriver类代码示例发布时间: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