Exemple #1
0
        // End of PrepareSqlString



        /// <summary>
        /// Wrapper function around the ShowProgress Delegate so that we can detremine whether or not
        /// a delegate event handler has been set up.
        /// </summary>
        /// <param name="progressDetails"></param>
        /// <returns></returns>
        protected int TryShowProgress(ProgressDetails progressDetails)
        {
            if (this.ShowProgress != null)
            {
                this.ShowProgress(progressDetails);
            }
            return(0);
        }
 protected bool TryShowProgress(ProgressDetails progressDetails)
 {
     if (this.ShowProgress != null)
     {
         return(this.ShowProgress(progressDetails));
     }
     return(true);
 }
        //
        //    Add
        //    ===
        //
        //    Adds a 'new' entry to the list of discovered assets.
        //
        public bool Add(DiscoveredItem newitem)
        {
            if (newitem.IPAddress.Length == 0)
            {
                newitem.IPAddress = IpAddress(newitem.Name);
            }

            // ..and log the progress
            ProgressDetails progressDetails = new ProgressDetails(ProgressDetails.eState.success, newitem.ToString());

            progressDetails.Tag = newitem;
            bool bCancelled = !TryShowProgress(progressDetails);

            return(bCancelled);
        }