Ejemplo n.º 1
0
        private void GlassWindow_Loaded( object sender, RoutedEventArgs e )
        {
            // update GlassRegion on window size change
            SizeChanged += new SizeChangedEventHandler( Window1_SizeChanged );

            // update background color on change of desktop composition mode
            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent( Window1_AeroGlassCompositionChanged );

            // Set the window background color
            if( AeroGlassCompositionEnabled )
            {
                // exclude the GDI rendered controls from the initial GlassRegion
                ExcludeElementFromAeroGlass( eb1 );
                SetAeroGlassTransparency( );
            }
            else
            {
                this.Background = System.Windows.Media.Brushes.Teal;
            }

            // initialize the explorer browser control
            eb1.NavigationTarget = (ShellObject)KnownFolders.Computer;

            // set the state of the Desktop Composition check box.
            EnableCompositionCheck.IsChecked = AeroGlassCompositionEnabled;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Uploading a File to FTP Server
        /// </summary>
        /// <param name="UploadFilePath">Path of the File on Local File System. ex: c:\Users\FileName.txt</param>
        /// <param name="UploadDirectory">Upload Directory on the Remote FTP Server</param>
        /// <param name="FtpClient">FTP Client We will be using</param>
        public frmUpload(string UploadFilePath, string UploadDirectory, FTPclient Ftpclient)
        {
            InitializeComponent();

            //Setup Variables
            FileName                = System.IO.Path.GetFileName(UploadFilePath);      //FileName without Directory. ex: FileName.txt
            lblFileName.Text        = Ftpclient.Hostname + UploadDirectory + FileName; //lblFileName displays full Upload Path.
            lblUploadDirectory.Text = UploadDirectory;                                 //Upload Directory
            FtpClient               = Ftpclient;

            //Aero Composition Event
            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent(frmUpload_AeroGlassCompositionChanged);

            if (AeroGlassCompositionEnabled)
            {
                //We don't want pnlNonTransparent and the controls in it to be part of AERO
                //but we do want Aero...looks cool ;)
                ExcludeControlFromAeroGlass(pnlNonTransparent);
            }
            else
            {
                this.BackColor = Color.Teal;
            }

            //Show Form
            this.Show();

            //Setup our Download Client and Start Downloading
            FtpClient.CurrentDirectory         = UploadDirectory;
            FtpClient.OnUploadCompleted       += new FTPclient.UploadCompletedHandler(FtpClient_OnUploadCompleted);
            FtpClient.OnUploadProgressChanged += new FTPclient.UploadProgressChangedHandler(FtpClient_OnUploadProgressChanged);
            FtpClient.Upload(UploadFilePath, UploadDirectory + FileName);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Renames a File on the Server
        /// </summary>
        /// <param name="fileName">Name of the File to Rename</param>
        /// <param name="CurrentDir">Directory that contains the file we want to rename</param>
        /// <param name="MainForm">Pass instance of the MainForm.  MainForm because we have Messages and the FtpClient on MainForm will show the Message passed by Rename.  There is probably another work around. But in a hurry I chose to do this.</param>
        /// <param name="extension">Extension of the File to rename</param>
        public frmRename(string fileName, string CurrentDir, frmMain MainForm, string extension)
        {
            //Set Data for variab;es
            Path      = CurrentDir;
            Extension = extension;
            FileName  = fileName;
            InitializeComponent();
            ForMain = MainForm;
            //Aero Composition Event
            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent(Form1_AeroGlassCompositionChanged);
            if (AeroGlassCompositionEnabled)
            {
                //We don't want pnlNonTransparent and the controls in it to be part of AERO
                //but we do want Aero Window...looks cool ;)
                ExcludeControlFromAeroGlass(pnlNonTransparent);
            }
            else
            {
                this.BackColor = Color.Teal;
            }

            //Set Information for User
            this.Text        = "Rename " + FileName;
            lblFileName.Text = "Filename: " + FileName;
            lblLocation.Text = "Location: " + Path;
        }
Ejemplo n.º 4
0
        public frmLogin()
        {
            //Init Form
            InitializeComponent();

            //Aero Composition Event
            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent(Form1_AeroGlassCompositionChanged);

            if (AeroGlassCompositionEnabled)
            {
                //We don't want pnlNonTransparent and the controls in it to be part of AERO
                //but we do want Aero...looks cool ;)
                ExcludeControlFromAeroGlass(pnlNonTransparent);
            }
            else
            {
                this.BackColor = Color.Teal;
            }
        }
Ejemplo n.º 5
0
        public Form1( )
        {
            InitializeComponent( );

            explorerBrowser1.Navigate( (ShellObject)KnownFolders.Desktop );

            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent( Form1_AeroGlassCompositionChanged );

            if( AeroGlassCompositionEnabled )
            {
                ExcludeControlFromAeroGlass( panel1 );
            }
            else
            {
                this.BackColor = Color.Teal;
            }

            // set the state of the Desktop Composition check box.
            compositionEnabled.Checked = AeroGlassCompositionEnabled;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// frmDownload constructor
        /// </summary>
        /// <param name="Filename">Name of the File to Download</param>
        /// <param name="Current_Directory">Current Directory of the FTPClient; where file will be downloaded from.</param>
        /// <param name="SavePath">Path where the File will be saved.</param>
        /// <param name="Ftpclient">FTPClient from frmMain that will be refrenced here to FtpClient variable.</param>
        public frmDownload(string Filename, string Current_Directory, string SavePath, FTPclient Ftpclient)
        {
            //Init Form
            InitializeComponent();

            //Setup Variables
            FileName             = Filename;
            SaveFilePath         = SavePath;
            CurrentDirectory     = Current_Directory;
            lblDownloadFrom.Text = Ftpclient.Hostname + Current_Directory + FileName;   //ex: ftp://ftp.somesite.com/current_dir/File.exe
            lblSavePath.Text     = SaveFilePath;
            FtpClient            = Ftpclient;
            TaskBarManager.ClearProgressValue();

            //Aero Composition Event
            AeroGlassCompositionChanged += new AeroGlassCompositionChangedEvent(Form1_AeroGlassCompositionChanged);

            if (AeroGlassCompositionEnabled)
            {
                //We don't want pnlNonTransparent and the controls in it to be part of AERO
                //but we do want Aero...looks cool ;)
                ExcludeControlFromAeroGlass(pnlNonTransparent);
            }
            else
            {
                this.BackColor = Color.Teal;
            }

            //Show Form
            this.Show();

            //Setup our Download Client and Start Downloading
            FtpClient.CurrentDirectory           = Current_Directory;
            FtpClient.OnDownloadProgressChanged += new FTPclient.DownloadProgressChangedHandler(FtpClient_OnDownloadProgressChanged);
            FtpClient.OnDownloadCompleted       += new FTPclient.DownloadCompletedHandler(FtpClient_OnDownloadCompleted);
            FtpClient.Download(FileName, SavePath, true);
        }