Example #1
0
 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);
         }
     }
 }
Example #2
0
 private static new 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();
     if (o == null)
         return new RepositoryItem[0];
     else if (o is RepositoryItem[])
         return (RepositoryItem[])o;
     else if (o is RepositoryItem)
         return new RepositoryItem[] { (RepositoryItem)o };
     return new RepositoryItem[0];
 }
Example #4
0
 internal RepositoryTreeModel(ServerConnectionManager connManager, TreeViewAdv tree, OpenResourceManager openResMgr, ClipboardService clip)
 {
     _connManager = connManager;
     _tree = tree;
     _openResMgr = openResMgr;
     _clip = clip;
 }