Esempio n. 1
0
        public bool PromptSaveDocument(string path)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }

            SccDocumentData data;

            if (!_docMap.TryGetValue(path, out data))
            {
                return(false);
            }

            data.CheckDirty(_poller);

            if (!data.IsDirty || (data.Cookie == 0))
            {
                return(true); // Not/never modified, no need to save
            }
            // Save the document if it is dirty
            return(VSErr.Succeeded(RunningDocumentTable.SaveDocuments((uint)__VSRDTSAVEOPTIONS.RDTSAVEOPT_PromptSave,
                                                                      data.Hierarchy, data.ItemId, data.Cookie)));
        }