Windows Develop Bookmark and Share   
 index > Windows Forms General > using threading for high performance
 

using threading for high performance


Hi all,

How can use BackgroundWorker or Threading for my code. I update TreeView (Winforms) and I call WCF service.

Any suggestions please. Kind regards.

Thanks in advance

AdministradorUILogging.TrazarDebug("PanelArbolFicheros. tslGuardarArbol_Click")

Dim listaFichero As New List(Of Fichero)

Windows.Forms.Cursor.Current = Cursors.WaitCursor

Me.TreeViewGB1.SuspendUpdate()

For Each nodo As NodoArbol In TreeViewGB1.Nodes

ProcesarNodo(nodo, listaFichero)

Next

Me.TreeViewGB1.ResumeUpdate()

' Cambiamos el cursor , tener en cuena si hacerlo asincrono

Try

Using bfll As New ComunBfll()

bfll.AltaManualListaFicheros(listaFichero)

Mensajes.InformacionGuardada()

End Using

Catch ex As WCF.ServicioBase.Contrato.Excepciones.NoExisteOperacionException

Mensajes.AdvertenciaErrores("No existe la operación")

Catch ex As WCF.ServicioBase.Contrato.Excepciones.NoExisteExpedienteException

Mensajes.AdvertenciaErrores("No existe el expediente")

Catch ex As WCF.ServicioBase.Contrato.Excepciones.ConsistenciaException

Mensajes.AdvertenciaErrores("Inconsistencia detectada al superar el máximo permitido de ficheros para un tipo documental")

Catch ex As Exception

AdministradorUILogging.TrazarError(Me.[GetType]().FullName & " -> " & System.Reflection.MethodBase.GetCurrentMethod().Name & "." & ex.Message)

ExcepcionesIUUtil.ProcesarExcepcionPresentacion(ex, Me.Container)

End Try

InicializarArbol()

Windows.Forms.Cursor.Current = Cursors.Arrow


http://www.alhambra-eidos.es/web2005/index.html
Alhambra Eidos Desarrollo  Tuesday, February 24, 2009 12:06 PM
Your code is very hard to read, I'd recommend posting here. Other than that, you already know the BackgroundWorker and Thread keywords. Yes, that's what you'll need. And Control.Invoke() to update the TreeView.

Hans Passant.
nobugz  Tuesday, February 24, 2009 1:50 PM
Your code is very hard to read, I'd recommend posting here. Other than that, you already know the BackgroundWorker and Thread keywords. Yes, that's what you'll need. And Control.Invoke() to update the TreeView.

Hans Passant.
nobugz  Tuesday, February 24, 2009 1:50 PM
any good sample for control.Invoke , any sample of real application ? with the best code source, like uses gurus MVPs.

Thanks.
http://www.alhambra-eidos.es/web2005/index.html
Alhambra Eidos Desarrollo  Thursday, February 26, 2009 10:32 AM
Hi,

You can clickhere to get more information about Control.Invoke, and there are many good samples. Besides, if you have questions about WCF Service, it’s likely to get quicker and better responses at Windows Communication Foundation.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Monday, March 02, 2009 6:22 AM

You can use google to search for other answers

Custom Search

More Threads

• How can I access two forms at the same time?
• Reading/Writing to Icon Library format (.ICL) in VB.NET
• transfer files in windows forms
• TextBox acquires input focus by default?
• Dialog box
• how to color combobox?
• Show/Hide a form with a .gif image
• How to Convert String Value to Text in C#?
• Controls on the MDI parent
• Window Proc