protected static void ResetClipboardedItems(ClipboardService clip, OpenResourceManager omgr, ServerConnectionManager connMgr)
 {
     //Reset state of clipboarded items
     if (clip.HasContent())
     {
         object o  = clip.Get();
         var    r  = o as RepositoryItem;
         var    rs = o as RepositoryItem[];
         if (r != null)
         {
             var conn = connMgr.GetConnection(r.ConnectionName);
             ResetItem(omgr, r, conn);
         }
         else if (rs != null)
         {
             ResetItems(omgr, rs, connMgr);
         }
     }
 }
 private new static void ResetClipboardedItems(ClipboardService clip, OpenResourceManager omgr, ServerConnectionManager connMgr)
 {
     //Reset state of clipboarded items
     if (clip.HasContent())
     {
         object o  = clip.Get();
         var    r  = o as RepositoryItem;
         var    rs = o as RepositoryItem[];
         if (r != null)
         {
             var conn = connMgr.GetConnection(r.ConnectionName);
             r.Reset();
             if (omgr.IsOpen(r.ResourceId, conn))
             {
                 r.IsOpen = true;
                 var ed = omgr.GetOpenEditor(r.ResourceId, conn);
                 if (ed.IsDirty)
                 {
                     r.IsDirty = true;
                 }
             }
         }
         else if (rs != null)
         {
             foreach (var ri in rs)
             {
                 var conn = connMgr.GetConnection(ri.ConnectionName);
                 ri.Reset();
                 if (omgr.IsOpen(ri.ResourceId, conn))
                 {
                     ri.IsOpen = true;
                     var ed = omgr.GetOpenEditor(ri.ResourceId, conn);
                     if (ed.IsDirty)
                     {
                         ri.IsDirty = true;
                     }
                 }
             }
         }
     }
 }
Example #3
0
        private static RepositoryItem[] GetItems(ClipboardService clip)
        {
            object o = clip.Get();

            var ri    = o as RepositoryItem;
            var riArr = o as RepositoryItem[];

            if (o == null)
            {
                return(new RepositoryItem[0]);
            }
            else if (riArr != null)
            {
                return(riArr);
            }
            else if (ri != null)
            {
                return new RepositoryItem[] { ri }
            }
            ;
            return(new RepositoryItem[0]);
        }
    }