Ejemplo n.º 1
0
 private void RemoveBgImage()
 {
     try
     {
         TreeNode tn = tvItems.SelectedNode;
         if (tn != null)
         {
             BgImage bgImage = tn.Tag as BgImage;
             if (MessageBoxUtils.AskLocalized("_removeitems"))
             {
                 tvItems.Nodes.Remove(tn);
                 BgImages.Remove(bgImage);
                 if (app.GetControlsAttr(ControlsAttr.AutoSave))
                 {
                     using (Context context = Lib.GetContext()) bgImage.Remove(context);
                 }
                 if (OnBgImageRemoved != null)
                 {
                     OnBgImageRemoved(this, new BgImageEventArgs(bgImage));
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }
Ejemplo n.º 2
0
 void RemoveView()
 {
     try
     {
         View selView = SelectedView;
         if (selView != null && !selView.IsOverall)
         {
             if (MessageBoxUtils.AskLocalized("_removeitems"))
             {
                 if (Views.Remove(selView))
                 {
                     this.UpdateList();
                     if (app.GetControlsAttr(ControlsAttr.AutoSave))
                     {
                         using (Context context = Lib.GetContext()) selView.Remove(context);
                     }
                     if (OnViewRemoved != null)
                     {
                         OnViewRemoved(this, new ViewEventArgs(selView));
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }