Пример #1
0
 /// <summary>
 /// Handler for a removed item by other editor
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void my_RemovedItem(object sender, ItemRemovedEventArgs e)
 {
     CoProFilterProvider.MySide = false;
     if (e.IsDeleted)
     {
         EnvDTE.Projects ps = gobj.DTE2.Solution.Projects;
         foreach (EnvDTE.Project p in ps)
         {
             string pname = p.Name;
             if (p.Name.Contains(e.Project))
             {
                 p.ProjectItems.Item(e.Name).Delete();
                 break;
             }
         }
     }
     else
     {
         EnvDTE.Projects ps = gobj.DTE2.Solution.Projects;
         foreach (EnvDTE.Project p in ps)
         {
             string pname = p.Name;
             if (p.Name.Contains(e.Project))
             {
                 p.ProjectItems.Item(e.Name).Remove();
                 break;
             }
         }
     }
     CoProFilterProvider.MySide = true;
 }
Пример #2
0
        /// <summary>
        /// Handler for a removed item by other editor
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void my_RemovedItem(object sender, ItemRemovedEventArgs e)
        {

            CoProFilterProvider.MySide = false;
            if (e.IsDeleted)
            {
                EnvDTE.Projects ps = gobj.DTE2.Solution.Projects;
                foreach (EnvDTE.Project p in ps)
                {
                    string pname = p.Name;
                    if (p.Name.Contains(e.Project))
                    {
                        p.ProjectItems.Item(e.Name).Delete();
                        break;
                    }
                }
            }
            else
            {
                EnvDTE.Projects ps = gobj.DTE2.Solution.Projects;
                foreach (EnvDTE.Project p in ps)
                {
                    string pname = p.Name;
                    if (p.Name.Contains(e.Project))
                    {
                        p.ProjectItems.Item(e.Name).Remove();
                        break;
                    }
                }
            }
            CoProFilterProvider.MySide = true;
        }