EnvDTE.Documents.Item(object)

Here are the examples of the csharp api class EnvDTE.Documents.Item(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: nodejstools
Source File: SessionNode.cs
View license
public int DeleteItem(uint dwDelItemOp, uint itemid)
        {
            Debug.Assert(_target.Reports != null && _target.Reports.Report != null && _target.Reports.Report.Length > 0);

            var report = GetReport(itemid);
            Reports.Remove((int)itemid);

            OnItemDeleted(itemid);
            OnInvalidateItems(ReportsItemId);

            if (File.Exists(report.Filename) && dwDelItemOp == (uint)__VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage)
            {
                // close the file if it's open before deleting it...
                var dte = (EnvDTE.DTE)NodejsProfilingPackage.GetGlobalService(typeof(EnvDTE.DTE));
                if (dte.ItemOperations.IsFileOpen(report.Filename))
                {
                    var doc = dte.Documents.Item(report.Filename);
                    doc.Close();
                }

                File.Delete(report.Filename);
            }

            return VSConstants.S_OK;
        }