public void Save(IDocument document, Uri uri) { CodeDocument codeDoc = document as CodeDocument; if (codeDoc != null) { codeDoc.Write(); } }