BuildingCoder.NestedFamilyFunctions.ValidateFamilyDocument C# (CSharp) Метод

ValidateFamilyDocument() приватный статический Метод

This method will validate the provided Revit Document to make sure the reference exists and is for a FAMILY document. It will throw an ArgumentNullException if nothing is sent, and will throw an ArgumentOutOfRangeException if the document provided isn't a family document (e.g. is a project document)
private static ValidateFamilyDocument ( Document document ) : void
document Document The Revit document being tested
Результат void
        private static void ValidateFamilyDocument(
            Document document)
        {
            if( null == document )
              {
            throw new ArgumentNullException( "document" );
              }

              if( !document.IsFamilyDocument )
              {
            throw new ArgumentOutOfRangeException(
              "The document provided is not a Family Document." );
              }
        }