4. In $\triangle A B C$, if $(\sin A+\sin B)(\cos A+\cos B)=2 \sin C$, then $\triangle A B C(\quad)$.
A. is an isosceles triangle but not necessarily a right triangle
B. is a right triangle but not necessarily an isosceles triangle
C. is neither an isosceles triangle nor a right triangle
D. is both an isosceles triangle and a right triangle
4. A. Hint: Left side $=\sin A \cos A+\sin A \cos B+\cos A \sin B+\sin B \cos B=\frac{1}{2}(\sin 2 A+\sin 2 B)+$ $\sin (A+B)=\sin (A+B) \cos (A-B)+\sin (A+B)$,
Right side $=2 \sin \left[180^{\circ}-(A+B)\right]=2 \sin (A+B)$.
Thus, $\sin (A+B)[\cos (A-B)-1]=0$.
Since $\sin (A+B)>0$, it follows that $\cos (A-B)=1$, hence $A=B$.
Taking $A=B=30^{\circ}, C=120^{\circ}$ and substituting into the condition, we find that it satisfies the condition.
Therefore, $\triangle A B C$ is an isosceles triangle, but not necessarily a right triangle.