public void AddItem(IExplorerItemModel item)
        {
            VerifyArgument.IsNotNull("item", item);
            VerifyArgument.IsNotNull("parent", item.Parent);
            Dev2Logger.Log.Info(String.Format("AddItem Name: {0} Type:{1}", item.DisplayName, item.ResourceType));
            var explorerItem = MapData(item);

            if (explorerItem != null)
            {
                try
                {
                    var result = GetExplorerProxy(item.EnvironmentId).AddItem(explorerItem, item.Parent.EnvironmentId);

                    if (result.Status != ExecStatus.Success)
                    {
                        throw new Exception(result.Message);
                    }
                }
                catch (Exception)
                {
                    item.Parent.Children.Remove(item);
                    item.OnChildrenChanged();
                    throw;
                }
            }
        }
        public void DeleteFolder(IExplorerItemModel item)
        {
            Dev2Logger.Log.Info(String.Format("Delete Folder Resource: {0} Id:{1}", item.DisplayName, item.EnvironmentId));
            VerifyArgument.IsNotNull("item", item);
            IExplorerItemModel parentItem = item.Parent;

            if (parentItem != null)
            {
                var found = parentItem.Children.FirstOrDefault(a => a.ResourcePath == item.ResourcePath && a.ResourceType == ResourceType.Folder);
                if (found != null)
                {
                    item = found;
                }
                if (parentItem.Children.Remove(item))
                {
                    try
                    {
                        var result = GetExplorerProxy(item.EnvironmentId).DeleteItem(MapData(item), Guid.Empty);
                        if (result.Status != ExecStatus.Success)
                        {
                            throw new Exception(result.Message);
                        }
                    }
                    catch (Exception)
                    {
                        parentItem.Children.Add(item);

                        throw;
                    }

                    parentItem.OnChildrenChanged();
                }
            }
        }
 static void AddChildItem(IExplorerItemModel parent, IExplorerItemModel explorerItem)
 {
     if (explorerItem != null)
     {
         if (explorerItem.ResourceId == Guid.Empty)
         {
             parent.Children.Add(explorerItem);
             parent.OnChildrenChanged();
         }
         else
         {
             var child = Instance.FindItem(i => i.ResourceId == explorerItem.ResourceId && i.Parent.ResourceId == parent.ResourceId && i.EnvironmentId == parent.EnvironmentId);
             if (child == null)
             {
                 parent.Children.Add(explorerItem);
                 parent.OnChildrenChanged();
             }
         }
     }
 }
 static void AddChildItem(IExplorerItemModel parent, IExplorerItemModel explorerItem)
 {
     if(explorerItem != null)
     {
         if(explorerItem.ResourceId == Guid.Empty)
         {
             parent.Children.Add(explorerItem);
             parent.OnChildrenChanged();
         }
         else
          {
             var child = Instance.FindItem(i => i.ResourceId == explorerItem.ResourceId && i.Parent.ResourceId == parent.ResourceId && i.EnvironmentId == parent.EnvironmentId);
             if(child == null)
             {
                 parent.Children.Add(explorerItem);
                 parent.OnChildrenChanged();
             }
         }
     }
 }
        public void AddItem(IExplorerItemModel item)
        {

            VerifyArgument.IsNotNull("item", item);
            VerifyArgument.IsNotNull("parent", item.Parent);
            Dev2Logger.Log.Info(String.Format("AddItem Name: {0} Type:{1}", item.DisplayName, item.ResourceType));
            var explorerItem = MapData(item);

            if(explorerItem != null)
            {
                try
                {
                    var result = GetExplorerProxy(item.EnvironmentId).AddItem(explorerItem, item.Parent.EnvironmentId);

                    if(result.Status != ExecStatus.Success)
                    {
                        throw new Exception(result.Message);
                    }
                }
                catch(Exception)
                {
                    item.Parent.Children.Remove(item);
                    item.OnChildrenChanged();
                    throw;
                }
            }
        }