示例#1
0
        public override void Perform(object o, IExplorer explorer)
        {
            if (ConfirmDelete(o))
            {
                SquadronHelper.Instance.StartAnimation();

                try
                {
                    if (o is SPSite)
                    {
                        (o as SPSite).Delete();
                    }

                    else if (o is SPWeb)
                    {
                        foreach (SPWeb web in _utility.GetWebsRecursively(o as SPWeb).Reverse())
                        {
                            try
                            {
                                web.Delete();
                            }
                            catch { }
                        }

                        (o as SPWeb).Delete();
                    }

                    else if (o is SPList)
                    {
                        (o as SPList).Delete();
                    }

                    explorer.DeleteSelectedNode();
                    SquadronContext.WriteMessage("Delete operation completed!");
                }
                finally
                {
                    SquadronHelper.Instance.StopAnimation();
                }
            }
        }