コード例 #1
0
        /// <summary>
        /// Выполняет чек-аут элемента проекта.
        /// </summary>
        /// <param name="dte"></param>
        /// <param name="item"></param>
        internal static void CheckOutItem(this DTE dte, ProjectItem item)
        {
            if (dte == null)
            {
                throw new ArgumentNullException(nameof(dte));
            }
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }


            string itemName = item.GetFullPath();

            dte.CheckOutItem(itemName);
        }
コード例 #2
0
        /// <summary>
        /// Выполняет чек-аут проекта.
        /// </summary>
        /// <param name="dte"></param>
        /// <param name="proj"></param>
        internal static void CheckOutItem(this DTE dte, Project proj)
        {
            Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();

            if (dte == null)
            {
                throw new ArgumentNullException(nameof(dte));
            }
            if (proj == null)
            {
                throw new ArgumentNullException(nameof(proj));
            }

            string projName = (proj.Properties.Item("LocalPath").Value ?? String.Empty).ToString();

            dte.CheckOutItem(projName);
        }