[Gambas-user] MapView "Proxy" Property override

gen braga genbraga1 at gmail.com
Tue Feb 12 16:25:50 CET 2019


I thought that way and even did so, but wasnt as aesthetical as i wished it
to be, and wasnt comply with the default interface from HttpClient as you
asked.

But we cant have everything as we wish, right? At least it works :-D

I'll submit it soon.

Thanks again Benoît.

Em ter, 12 de fev de 2019 às 12:52, Benoît Minisini <g4mba5 at gmail.com>
escreveu:

> Le 12/02/2019 à 15:21, gen braga a écrit :
> > Things become easier with example code :-D
> >
> > Attached modified sources only, from gb.map . Everything else from Git.
> >
> > Problem is in MapView.class, line 19:
> >
> > Property Read Proxy1 As Proxy
> >
> > should be something like:
> >
> > Property Read Proxy As _Proxy
> >
> > but I get an override error...
> >
> > Gen.
> >
>
> Ha, sorry I forgot the Proxy property inherited from UserControl...
>
> I suggest you add the Proxy property to the Map class instead. Something
> like that:
>
> --8<--------------------------------------------------
>
> ' Map.class
>
> Public _Proxy as _MapProxy
>
> Property Read Proxy As _MapProxy
>
> Private Sub Proxy_Read() as _MapProxy
>
>    If Not _Proxy Yhen _Proxy = New _MapProxy
>    Return _Proxy
>
> End
>
> ' _MapProxy.class
>
> Public Auth As Integer
> Public Host As String
> Public Password As String
> Public Type As Integer
> Public User As String
>
> ' _MapLayer.class
>
> Public Sub _new(Optional CacheName As String)
>
>    ...
>
>    For I = 0 To $aClients.Max
>      hClient = New HttpClient As "Client"
>      ...
>      With GetMap()
>        If ._Proxy Then
>          hClient.Proxy.Auth = ._Proxy.Auth
>          hClient.Proxy.Host = ._Proxy.Host
>          ' ... and so on
>       Endif
>    Next
>
> End
>
> --8<--------------------------------------------------
>
> @Fabien: why do _get() and _next() return Object instead of _MapLayer?
>
> --
> Benoît Minisini
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190212/9e647d30/attachment-0001.html>


More information about the User mailing list