According to Hartshorne's textbook, the definition of an affine scheme is a locally ringed space $(X,\mathcal{O}_{x})$ which is isomorphic (as a locally ringed space) to the spectrum of some ring. More precisely, there exists a ring R such that,
i) $f: X \to \operatorname{Spec} R $ : homeomorphism
ii) $f^{\sharp} : \mathcal{O}_{\operatorname{Spec} R} \to f_{*}\mathcal{O}_{X}$ : isomorphism (where $f_* \mathcal{O}_X=\mathcal{O}_Xf^{-1})$
However, in comparison to Hartshorne's textbook, according to the following PDF,
Let the topological space $X$ along with the sheaf $\mathcal{O}_X$ be a locally ringed space, where $\mathcal{O}_X(X)=R$. Then $X$ along with its sheaf $\mathcal{O}_X$, which we will denote $(X,\mathcal{O}_{x})$, is an affine scheme if it is isomorphic to $(\operatorname{Spec} R,\mathcal{O}_{\operatorname{Spec} R})$, which is true when the following conditions hold :
i) $X$ and $\operatorname{Spec} R$ are homeomorphic as topological spaces
ii') $\mathcal{O}_X(X_f)=R_f$ (where $X_f = \operatorname{Spec} R - V(f)$, $R_f$ is the localization $R$ at $f$ )
My question is whether the condition ii) on Hartshorne's textbook is equivalent to ii)' on the definition on the PDF