Load() public static method

Loads the specified file path.
public static Load ( string filePath ) : ManagedApplication
filePath string The file path.
return ManagedApplication
コード例 #1
0
        /// <summary>
        /// Adds an application to manage to the drop down menu.
        /// </summary>
        private int AddApplicationToManage(FileInfo fileInfo)
        {
            // ignore files that don't exist.
            if (fileInfo == null || !fileInfo.Exists)
            {
                return(ApplicationToManageCB.SelectedIndex);
            }

            try
            {
                ManagedApplication application = ManagedApplication.Load(fileInfo.FullName);

                if (application == null)
                {
                    return(ApplicationToManageCB.SelectedIndex);
                }

                // add to list.
                return(AddApplicationToManage(application));
            }

            // ignore errors.
            catch (Exception)
            {
                return(ApplicationToManageCB.SelectedIndex);
            }
        }