﻿
Partial Class ETGPDF
    Inherits System.Web.UI.UserControl

    'Variables.
    Private mstrHeight As String
    Private mstrWidth As String
    Private mstrPDFFile As String

    <System.ComponentModel.Browsable(True)> _
  <System.ComponentModel.Category("Behavior")> _
    Public Property PDFFile() As String

        Get

            'Check property.
            If mstrPDFFile = "" Then
                mstrPDFFile = "/media/kw_brochure_011212.pdf"
            End If

            'Get property.
            Return mstrPDFFile

        End Get

        Set(ByVal value As String)

            'Set property.
            mstrPDFFile = value

        End Set

    End Property


    <System.ComponentModel.Browsable(True)> _
   <System.ComponentModel.Category("Behavior")> _
    Public Property Height() As String

        Get

            'Check property.
            If mstrHeight = "" Then
                mstrHeight = "400"
            End If

            'Get property.
            Return mstrHeight

        End Get

        Set(ByVal value As String)

            'Set property.
            mstrHeight = value

        End Set

    End Property

    <System.ComponentModel.Browsable(True)> _
  <System.ComponentModel.Category("Behavior")> _
    Public Property Width() As String

        Get

            'Check property.
            If mstrWidth = "" Then
                mstrWidth = "640"
            End If

            'Get property.
            Return mstrWidth

        End Get

        Set(ByVal value As String)

            'Set property.
            mstrWidth = value

        End Set

    End Property

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        'Check for sitefinity.
        If InStr(LCase(Request.Url.AbsolutePath), "/action/edit") > 0 Then
            divContainer.Visible = False
        End If

        'Set width and height.
        divContainer.Attributes.Add("style", "width:" & Me.Width & "px;height:" & Me.Height & "px;")

    End Sub

End Class
