/// ******************************************************************************** /// <summary> /// Check that the path is not too long. /// </summary> /// <param name="value">The path to check for length.</param> /// <created>art2m,6/6/2019</created> /// <changed>art2m,6/6/2019</changed> /// ******************************************************************************** public static void ValidatePathToLong([NotNull] string value) { MyMessagesClass.NameOfMethod = MethodBase.GetCurrentMethod().Name; try { Path.GetFullPath(value); } catch (PathTooLongException ex) { MyMessagesClass.ErrorMessage = "The path is too long. exiting operation. " + value; MyMessagesClass.ShowErrorMessageBox(); Debug.WriteLine(ex.ToString()); } catch (SecurityException ex) { MyMessagesClass.ErrorMessage = "You do not have required permissions."; MyMessagesClass.ShowErrorMessage(); } catch (ArgumentNullException ex) { } catch (NotSupportedException ex) { } catch (ArgumentException ex) } }