Microsoft.VisualStudio.Project.ReferenceNode.CanAddReference C# (CSharp) Method

CanAddReference() protected method

Validates that a reference can be added.
protected CanAddReference ( CannotAddReferenceErrorMessage &errorHandler ) : bool
errorHandler CannotAddReferenceErrorMessage A CannotAddReferenceErrorMessage delegate to show the error message.
return bool
        protected virtual bool CanAddReference(out CannotAddReferenceErrorMessage errorHandler)
        {
            // When this method is called this refererence has not yet been added to the hierarchy, only instantiated.
            errorHandler = null;
            if(this.IsAlreadyAdded())
            {
                return false;
            }

            return true;
        }