[CLOSED] translation problem

  1. #1

    [CLOSED] translation problem

    Hello

    I see this syntax in desktop example :

     [DirectMethod(ShowMask = true)]
        public void CreateWindow()
    ....
    Ig I try to implement in VB:

      <DirectMethod(ShowMask = True)> Public Sub BuildChartWindow(ByVal ChartToDraw As String)
    I have a compilation error in ShowMask : "ShowMask is not declared, or is innaccessible".

    Besides that, I have a lot of parameters I can use when I see the Intellisense of directmethod. So, how to translate?
    Last edited by Daniil; Jun 14, 2012 at 8:54 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You should use ":=" in VB.NET.
    <DirectMethod(ShowMask:=True)>
    I have got it from the "Attribute Parameters" part here:
    http://msdn.microsoft.com/en-us/libr...1kczw.aspx#Y28

    Example
    <%@ Page Language="VB" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        <DirectMethod(ShowMask:=True)>
        Public Sub TestDirectMethod()
            System.Threading.Thread.CurrentThread.Sleep(1500)
            ExtNet.Msg.Alert("DirectMethod", "Hello from Server!").Show()
        End Sub
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Button runat="server" Text="DirectMethod">
            <Listeners>
                <Click Handler="App.direct.TestDirectMethod();" />
            </Listeners>
        </ext:Button>
    </body>
    </html>
  3. #3
    Works like a charm. I was not close to the solution, thanks a lot
  4. #4
    Do you remeber this function:

    <DirectMethod(ShowMask:=True)> Public Sub SaveCharts(ByVal ChartName As String, ByVal chartSVG As String)
    
            Dim ms As New MemoryStream()
            SavePNG(ms, chartSVG, ChartName)
    
            'Convert the memorystream to an array of bytes.
            Dim byteArray() As Byte = ms.ToArray()
            'Clean up the memory stream
            ms.Flush()
            ms.Close()
            ' Clear all content output from the buffer stream
            Response.Clear()
            Response.BufferOutput = True
            Response.ClearHeaders()
            ' Add a HTTP header to the output stream that specifies the default filename
            ' for the browser's download dialog
            Response.AddHeader("Content-Type", "application/force-download")
            Response.AddHeader("Content-Disposition", "attachment; filename=" + ChartName + ".png")
            Response.AddHeader("Content-Length", byteArray.Length.ToString())
            ' Add a HTTP header to the output stream that contains the 
            ' content length(File Size). This lets the browser know how much data is being transfered
            ' Set the HTTP MIME type of the output stream
            Response.ContentType = "application/octet-stream"
            ' Write the data out to the client.
            Response.BinaryWrite(byteArray)
            Response.End()
    
        End Sub
    The mask is not removed. I suppose that is because I use the response to transmit the file, A solution (else I will not display the mask).
  5. #5
    This is the limitation of AJAX downloading - the success/failure events are not fired, so, no way to hide a mask.

    Please follow:
    http://forums.ext.net/showthread.php?19430

    There is the approach which could be helpful for you.

Similar Threads

  1. Replies: 5
    Last Post: Dec 03, 2012, 4:17 AM
  2. [CLOSED] Translation/localization, Official or Best Practices
    By opendat2000 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 09, 2011, 2:36 PM
  3. Missing translation in javascript
    By Raynald_Fontaine in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 09, 2010, 10:24 PM
  4. [CLOSED] Missing translation in javascript file
    By Raynald_Fontaine in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 05, 2010, 6:22 PM
  5. [CLOSED] The translation does not work using .net local file resources?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 11, 2010, 2:45 PM

Posting Permissions