當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。