本文整理汇总了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");
}
示例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);
}
示例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);
}
示例4: HtmlToClrEventProxy
public HtmlToClrEventProxy(object sender, string eventName, EventHandler eventHandler) {
this.eventHandler = eventHandler;
this.eventName = eventName;
Type htmlToClrEventProxyType = typeof(HtmlToClrEventProxy);
typeIReflectImplementation = htmlToClrEventProxyType as IReflect;
}
示例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
}
示例6: UICommand
public UICommand(IContainer container)
{
container.Add(this);
InitializeComponent();
ClickForwarderDelegate = new EventHandler(ClickForwarder);
}
示例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 { }
}
示例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);
}
示例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);
}
示例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;
}
}
示例11: AttachEssentailHandlers
public void AttachEssentailHandlers(
EventHandler<ImageRequestEventArgs> reqImageHandler,
EventHandler<TextRequestEventArgs> reqStyleSheetHandler)
{
this.requestImage = reqImageHandler;
this.requestStyleSheet = reqStyleSheetHandler;
}
示例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;
}
示例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;
}
示例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;
}
示例15: MainPage
public MainPage()
{
this.Unloaded += new RoutedEventHandler(MainPage_Unloaded);
BindingValidationError += new EventHandler<ValidationErrorEventArgs>(MainPage_BindingValidationError);
// Required to initialize variables
InitializeComponent();
}