public override void OnClosed(EventArgs e)
        {
            if (currentLibraryProvider != null)
            {
                currentLibraryProvider.DataReloaded -= LibraryDataReloaded;
                currentLibraryProvider.Dispose();
                currentLibraryProvider = null;
            }

            if (unregisterEvents != null)
            {
                unregisterEvents(this, null);
            }
            base.OnClosed(e);
            libraryDataViewInstance = null;
        }
Ejemplo n.º 2
0
 void DoAddToSpecificLibrary(SaveAsWindow.SaveAsReturnInfo returnInfo)
 {
     if (returnInfo != null)
     {
         List <QueueRowItem> selectedItems   = new List <QueueRowItem>(queueDataView.SelectedItems);
         LibraryProvider     libraryToSaveTo = returnInfo.destinationLibraryProvider;
         if (libraryToSaveTo != null)
         {
             foreach (QueueRowItem queueItem in selectedItems)
             {
                 if (File.Exists(queueItem.PrintItemWrapper.FileLocation))
                 {
                     PrintItemWrapper printItemWrapper = new PrintItemWrapper(new PrintItem(queueItem.PrintItemWrapper.PrintItem.Name, queueItem.PrintItemWrapper.FileLocation), returnInfo.destinationLibraryProvider.GetProviderLocator());
                     libraryToSaveTo.AddItem(printItemWrapper);
                 }
             }
             libraryToSaveTo.Dispose();
         }
     }
 }
Ejemplo n.º 3
0
        public override void OnClosed(ClosedEventArgs e)
        {
            currentLibraryProvider.DataReloaded -= LibraryDataReloaded;

            if (unregisterEvents != null)
            {
                unregisterEvents(this, null);
            }

            // Dispose of all children below this one.
            // Dispose of all children below this one.
            while (currentLibraryProvider != null &&
                   currentLibraryProvider.ParentLibraryProvider != null)
            {
                LibraryProvider parent = currentLibraryProvider.ParentLibraryProvider;
                currentLibraryProvider.Dispose();
                currentLibraryProvider = parent;
            }

            base.OnClosed(e);
        }
Ejemplo n.º 4
0
 void DoAddToSpecificLibrary(SaveAsWindow.SaveAsReturnInfo returnInfo)
 {
     if (returnInfo != null)
     {
         LibraryProvider libraryToSaveTo = returnInfo.destinationLibraryProvider;
         if (libraryToSaveTo != null)
         {
             foreach (var queueItemIndex in QueueData.Instance.SelectedIndexes)
             {
                 var queueItem = queueDataView.GetQueueRowItem(queueItemIndex);
                 if (queueItem != null)
                 {
                     if (File.Exists(queueItem.PrintItemWrapper.FileLocation))
                     {
                         PrintItemWrapper printItemWrapper = new PrintItemWrapper(new PrintItem(queueItem.PrintItemWrapper.PrintItem.Name, queueItem.PrintItemWrapper.FileLocation), returnInfo.destinationLibraryProvider.GetProviderLocator());
                         libraryToSaveTo.AddItem(printItemWrapper);
                     }
                 }
             }
             libraryToSaveTo.Dispose();
         }
     }
 }