4. In $\triangle A B C$, if $(\sin A+\sin B)(\cos A+\cos B)=2 \sin C$, then ( ).
(A) $\triangle A B C$ is an isosceles triangle, but not necessarily a right triangle
(B) $\triangle A B C$ is a right triangle, but not necessarily an isosceles triangle
(C) $\triangle A B C$ is neither an isosceles triangle nor a right triangle
(D) $\triangle A B C$ is both an isosceles triangle and a right triangle
4.A.
$$
\begin{array}{c}
\text { Left side }=\sin A \cdot \cos A+\sin A \cdot \cos B+ \\
\quad \sin B \cdot \cos A+\sin B \cdot \cos B \\
=\frac{1}{2}(\sin 2 A+\sin 2 B)+\sin (A+B) \\
=\sin (A+B) \cdot \cos (A-B)+\sin (A+B), \\
\text { Right side }=2 \sin (A+B) .
\end{array}
$$

Therefore, the given equation can be transformed into
$$
\sin (A+B)[\cos (A-B)-1]=0 .
$$

Since $\sin (A+B)>0$, it follows that $\cos (A-B)=1$.
Thus, $\angle A=\angle B$.
On the other hand, $\angle A=\angle B=30^{\circ}, \angle C=120^{\circ}$ also satisfies the given conditions.

Therefore, $\triangle ABC$ is an isosceles triangle, but it is not necessarily a right triangle.