Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1044755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:52:42+00:00 2026-05-16T15:52:42+00:00

I tried following the example given on MSDN , but my code does not

  • 0

I tried following the example given on MSDN, but my code does not compile on the compact framework. It does compile on the normal framework, though.

type StorageComponent(game) =
    inherit GameComponent(game)

let title_storage_acquired_event = new Control.DelegateEvent<StorageEventHandler>()

Error message:

The type ‘DelegateEvent’ is not defined

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:52:42+00:00Added an answer on May 16, 2026 at 3:52 pm

    Based on the hint from Brian, it looks that the types DelegateEvent<'Delegate> and Event<'Delegate, 'Args> are not supported on .NET Compact Framework. This would mean that you cannot declare an event that uses an explicitly specified delegate type.

    However, you can still use the Event<'T> type which creates an event of type Handler<'T> (which is a generic delegate type representing methods with two parameters of types obj and 'T):

    type StorageComponent(game) = 
      inherit GameComponent(game) 
    
      let titleStorageAcquiredEvent = 
        new Event<StorageEventArgs>() 
    
      [<CLIEvent>] // If you want to create C# compatible event
      member x.TitleStorageAcquired = 
        titleStorageAcquiredEvent.Publish()
    

    Assuming that the declaration of StorageEventHandler looks like this:

    delegate void StorageEventHandler(object sender, StorageEventArgs args);
    

    The example above should create more or less an equivalent code (with the only difference that it uses generic Handler<_> delegate type instead of your own StorageEventHandler).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried following the gradle manual with their example like this but copyJars is
I am really new to SWIG. I tried to compile the example given in
I tried following the following example to make an HTTP link in my TextView
I tried the following example for applying a linear gradient: GradientPaintDemo2D . It works
In the following example (apologies for the length) I have tried to isolate some
In the following example, I tried to use uninterpreted Boolean function like (declare-const p
I tried to use dat.GUI in the following three.js example . I just did
Following the README instructions of the jboss-as-kitchensink example , I have tried to run
Bare with the following, as I tried to think of a simple example and
I tried following the instruction s but can't get the plugin to work, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.