Пример #1
0
        /// <summary>
        /// Set default property values.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void PGPUIForm_Load(object sender, EventArgs e)
        {
            try
            {
                PropertiyBag prop = new PropertiyBag();

                if (_taskHost != null)
                {
                    /* Add User Variables to the Dropdown. */
                    List <string> vars = _taskHost.Variables.OfType <Variable>().Where(x => x.SystemVariable == false).Select(x => x.QualifiedName).ToList <string>();
                    UserVariables.ListOfUserVariables = new string[vars.Count];
                    UserVariables.ListOfUserVariables = vars.ToArray();

                    prop.name            = _taskHost.Name;
                    prop.description     = _taskHost.Description;
                    prop.sourceFile      = _taskHost.GetValue <string>(CONSTANTS.PGPSOURCEFILE);
                    prop.targetFile      = _taskHost.GetValue <string>(CONSTANTS.PGPTARGETFILE);
                    prop.publicKey       = _taskHost.GetValue <string>(CONSTANTS.PGPPUBLICKEY);
                    prop.privateKey      = _taskHost.GetValue <string>(CONSTANTS.PGPPRIVATEKEY);
                    prop.passPhrase      = _taskHost.GetValue <string>(CONSTANTS.PGPPASSPHRASE);
                    prop.overwriteTarget = _taskHost.GetValue <bool>(CONSTANTS.PGPOVERWRITETARGET);
                    prop.removeSource    = _taskHost.GetValue <bool>(CONSTANTS.PGPREMOVESOURCE);
                    prop.fileAction      = (PGPFileAction)Enum.Parse(typeof(PGPFileAction), _taskHost.GetValue <string>(CONSTANTS.PGPFILEACTION));
                    prop.isArmored       = _taskHost.GetValue <bool>(CONSTANTS.PGPARMORED);
                    //prop.logLevel = (LogLevel)Enum.Parse(typeof(LogLevel), _taskHost.GetValue<string>(CONSTANTS.PGPLOGLEVEL));
                }

                this.propertyGrid.SelectedObject = prop;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
Пример #2
0
        /// <summary>
        /// Set default property values.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void ZipUIForm_Load(object sender, EventArgs e)
        {
            try
            {
                PropertyBag prop = new PropertyBag();

                if (_taskHost != null)
                {
                    /* Add User Variables to the Dropdown. */
                    List <string> vars = _taskHost.Variables.OfType <Variable>().Where(x => x.SystemVariable == false).Select(x => x.QualifiedName).ToList <string>();
                    UserVariables.ListOfUserVariables = new string[vars.Count];
                    UserVariables.ListOfUserVariables = vars.ToArray();

                    prop.name                = _taskHost.Name;
                    prop.description         = _taskHost.Description;
                    prop.fileAction          = (ZipFileAction)Enum.Parse(typeof(ZipFileAction), _taskHost.GetValue <string>(CONSTANTS.ZIPFILEACTION));
                    prop.compressionType     = (CompressionType)Enum.Parse(typeof(CompressionType), _taskHost.GetValue <string>(CONSTANTS.ZIPCOMPRESSIONTYPE));
                    prop.zipCompressionLevel = (ZipCompressionLevel)Enum.Parse(typeof(ZipCompressionLevel), _taskHost.GetValue <string>(CONSTANTS.ZIPCOMPRESSIONLEVEL));
                    prop.tarCompressionLevel = (TarCompressionLevel)Enum.Parse(typeof(TarCompressionLevel), _taskHost.GetValue <string>(CONSTANTS.TARCOMPRESSIONLEVEL));
                    prop.zipPassword         = _taskHost.GetValue <string>(CONSTANTS.ZIPPASSWORD);
                    prop.sourceFile          = _taskHost.GetValue <string>(CONSTANTS.ZIPSOURCE);
                    prop.removeSource        = _taskHost.GetValue <bool>(CONSTANTS.ZIPREMOVESOURCE);
                    prop.recursive           = _taskHost.GetValue <bool>(CONSTANTS.ZIPRECURSIVE);
                    prop.targetFile          = _taskHost.GetValue <string>(CONSTANTS.ZIPTARGET);
                    prop.overwriteTarget     = _taskHost.GetValue <bool>(CONSTANTS.ZIPOVERWRITE);
                    prop.fileFilter          = _taskHost.GetValue <string>(CONSTANTS.ZIPFILEFILTER);
                    prop.logLevel            = (LogLevel)Enum.Parse(typeof(LogLevel), _taskHost.GetValue <string>(CONSTANTS.ZIPLOGLEVEL));
                }

                this.propertyGrid.SelectedObject = prop;
            }
            catch (Exception ex)
            {
                //IDTSComponentEvents ce = (IDTSComponentEvents)_taskHost.Properties[CONSTANTS.COMPONENTEVENTS].GetValue(_taskHost);
                //ce.FireError(1, "PGP Task UI Form", ex.Message, "", 0);
                MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
Пример #3
0
        /// <summary>
        /// Set default property values.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void SFTPUIForm_Load(object sender, EventArgs e)
        {
            try
            {
                PropertyBag prop = new PropertyBag();

                if (_taskHost != null)
                {
                    /* Add User Variables to the Dropdown. */
                    List <string> vars = _taskHost.Variables.OfType <Variable>().Where(x => x.SystemVariable == false).Select(x => x.QualifiedName).ToList <string>();
                    UserVariables.ListOfUserVariables = new string[vars.Count];
                    UserVariables.ListOfUserVariables = vars.ToArray();

                    prop.name                   = _taskHost.Name;
                    prop.description            = _taskHost.Description;
                    prop.localFile              = _taskHost.GetValue <string>(CONSTANTS.SFTPLOCALFILE);
                    prop.remoteFile             = _taskHost.GetValue <string>(CONSTANTS.SFTPREMOTEFILE);
                    prop.remoteFileListVariable = _taskHost.GetValue <string>(CONSTANTS.SFTPREMOTEFILELISTVAR);
                    prop.hostName               = _taskHost.GetValue <string>(CONSTANTS.SFTPHOST);
                    prop.portNumber             = _taskHost.GetValue <string>(CONSTANTS.SFTPPORT);
                    prop.userName               = _taskHost.GetValue <string>(CONSTANTS.SFTPUSER);
                    prop.passWord               = _taskHost.GetValue <string>(CONSTANTS.SFTPPASSWORD);
                    prop.stopOnFailure          = _taskHost.GetValue <bool>(CONSTANTS.SFTPSTOPONFAILURE);
                    prop.localOverwrite         = _taskHost.GetValue <bool>(CONSTANTS.SFTPOVERWRITEDEST);
                    prop.remoteOverwrite        = _taskHost.GetValue <bool>(CONSTANTS.SFTPOVERWRITEDEST);
                    prop.localRemove            = _taskHost.GetValue <bool>(CONSTANTS.SFTPREMOVESOURCE);
                    prop.remoteRemove           = _taskHost.GetValue <bool>(CONSTANTS.SFTPREMOVESOURCE);
                    //prop.reTries = Convert.ToInt32(GetValue(CONSTANTS.SFTPRETRIES));
                    prop.fileAction             = (SFTPFileAction)Enum.Parse(typeof(SFTPFileAction), _taskHost.GetValue <string>(CONSTANTS.SFTPFILEACTION));
                    prop.sftpFileInfo           = _taskHost.GetValue <string>(CONSTANTS.SFTPFILEINFO);
                    prop.localIncludeSubFolders = _taskHost.GetValue <bool>(CONSTANTS.SFTPISRECURSIVE);
                    prop.localFilter            = _taskHost.GetValue <string>(CONSTANTS.SFTPFILEFILTER);
                    prop.remoteFilter           = _taskHost.GetValue <string>(CONSTANTS.SFTPFILEFILTER);
                    prop.logLevel = (LogLevel)Enum.Parse(typeof(LogLevel), _taskHost.GetValue <string>(CONSTANTS.SFTPLOGLEVEL));
                }

                this.propertyGrid.SelectedObject = prop;
            }
            catch (Exception ex)
            {
                //IDTSComponentEvents ce = (IDTSComponentEvents)_taskHost.Properties[CONSTANTS.COMPONENTEVENTS].GetValue(_taskHost);
                //ce.FireError(1, "PGP Task UI Form", ex.Message, "", 0);
                MessageBox.Show(ex.Message);
            }
        }