Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Designer does not take my own class
Message
De
21/12/2005 17:07:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Designer does not take my own class
Divers
Thread ID:
01080038
Message ID:
01080038
Vues:
48
I changed the default ApplicationEvents.vb file to use my own application class intead. So, the default ApplicationEvents.vb file is:
Namespace My

    ' The following events are availble for MyApplication:
    ' 
    ' Startup: Raised when the application starts, before the startup form is created.
    ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
    ' UnhandledException: Raised if the application encounters an unhandled exception.
    ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
    ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
    Partial Friend Class MyApplication

    End Class

End Namespace
I changed it to:
Namespace My

    ' The following events are availble for MyApplication:
    ' 
    ' Startup: Raised when the application starts, before the startup form is created.
    ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
    ' UnhandledException: Raised if the application encounters an unhandled exception.
    ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
    ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
    Partial Friend Class App

        Inherits Framework.App

    End Class

End Namespace
But, when I compile, the Application.Designer.vb always en up with the default code which points to MyApplication. So, when I run the application, I cannot have my own application code to be executed. My application class looks like this:
Imports System.Data.OleDb
Imports Microsoft.VisualBasic.ApplicationServices
Imports System.Windows.Forms

Public Class App
    Inherits Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase

    Public Sub New()
        MyBase.New(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
        MyBase.EnableVisualStyles = True
        MyBase.ShutdownStyle = ShutdownMode.AfterAllFormsClose
        MyBase.IsSingleInstance = True
        MessageBox.Show("Start")
    End Sub

    Private Sub App_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
        'Framework.App.oApplication = System.Windows.Forms.Application
        Framework.App.Initialize()
        MessageBox.Show("Initialize")
    End Sub

    Private Sub App_StartupNextInstance(ByVal sender As Object, _
     ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
        MessageBox.Show("Application is already running...")
    End Sub

End Class
What adjustement should I do in order to have it to use my own Framework.App class?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Répondre
Fil
Voir

Click here to load this message in the networking platform