Пример #1
0
 void formMimic_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(Client.Model.PresetModel)))
     {
         Client.Model.PresetModel presetData = null;
         if ((presetData = (Client.Model.PresetModel)e.Data.GetData(typeof(Client.Model.PresetModel))) != null)
         {
             clientPresenter.TriggerPreset(presetData);
         }
     }
     else if (e.Data.GetDataPresent(typeof(Client.Model.VncModel)))
     {
         Client.Model.VncModel vncData = null;
         if ((vncData = (Client.Model.VncModel)e.Data.GetData(typeof(Client.Model.VncModel))) != null)
         {
             presetHelper.AddTriggeredVNC(vncData);
             clientPresenter.TriggerVnc(vncData);
         }
     }
     else if (e.Data.GetDataPresent(typeof(Client.Model.WindowsModel)))
     {
         Client.Model.WindowsModel appData = null;
         if ((appData = (Client.Model.WindowsModel)e.Data.GetData(typeof(Client.Model.WindowsModel))) != null)
         {
             if ((appData.Style & Constant.WS_MINIMIZE) != 0)
             {
                 // restore the window first
                 clientPresenter.SetApplicationRestore(appData.WindowsId);
             }
             else
             {
                 clientPresenter.SetApplicationForeground(appData.WindowsId);
             }
         }
     }
     else if (e.Data.GetDataPresent(typeof(Client.Model.ApplicationModel)))
     {
         Client.Model.ApplicationModel applicationData = null;
         if ((applicationData = (Client.Model.ApplicationModel)e.Data.GetData(typeof(Client.Model.ApplicationModel))) != null)
         {
             presetHelper.AddTriggeredApplication(applicationData);
             clientPresenter.TriggerApplication(applicationData);
         }
     }
     else if (e.Data.GetDataPresent(typeof(InputAttributes)))
     {
         InputAttributes attributeData = null;
         if ((attributeData = (InputAttributes)e.Data.GetData(typeof(InputAttributes))) != null)
         {
             presetHelper.AddTriggeredVisionInput(attributeData);
             clientPresenter.TriggerVisionInput(attributeData);
         }
     }
 }
Пример #2
0
 void formPreset_EvtPresetRemoved(FormPresets form, Client.Model.PresetModel item)
 {
     if (MessageBox.Show("Are you sure want to remove selected preset?",
                         "Warning",
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Warning,
                         MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes)
     {
         // remove a preset
         clientPresenter.RemovePreset(item);
     }
 }