예제 #1
0
        /// <summary>
        /// Helper method to remove the real time stylus plugin
        /// at the specified index from the plugin collection.
        /// </summary>
        /// <param name="index">The index of the plugin to remove.</param>
        private void RemoveFromPluginCollection(int index)
        {
            IStylusSyncPlugin plugin = ((PluginListItem)chklbPlugins.Items[index]).Plugin;

            bool rtsEnabled = myRealTimeStylus.Enabled;

            myRealTimeStylus.Enabled = false;
            myRealTimeStylus.SyncPluginCollection.Remove(plugin);
            myRealTimeStylus.Enabled = rtsEnabled;
        }
예제 #2
0
        private static void AddInputPlugin([NotNull] RealTimeStylus stylusInput, IStylusSyncPlugin plugin)
        {
            if (plugin == null || stylusInput.SyncPluginCollection == null)
            {
                throw new Exception("Input state not correct");
            }
            var rtsEnabled = stylusInput.Enabled;

            stylusInput.Enabled = false;
            stylusInput.SyncPluginCollection.Add(plugin);
            stylusInput.Enabled = rtsEnabled;
        }
예제 #3
0
        public TouchEventAdapter(UnoGLControl form)
        {
            var graphics = form.CreateGraphics();

            StylusSyncPlugin = new StylusSyncPluginImpl(form, this, graphics.DpiX, graphics.DpiY);

            var stylus = new RealTimeStylus(form);

            stylus.MultiTouchEnabled = true;
            stylus.SyncPluginCollection.Add(StylusSyncPlugin);
            stylus.Enabled = true;
        }
예제 #4
0
        /// <summary>
        /// Helper method to insert the real time stylus plugin
        /// at the specified index into the plugin collection.
        /// </summary>
        /// <param name="index">The index of the plugin to insert.</param>
        private void InsertIntoPluginCollection(int index)
        {
            // Obtain the index where the plugin should be inserted
            int insertAtIndex        = FindPrecedingPlugin(index);
            IStylusSyncPlugin plugin = ((PluginListItem)chklbPlugins.Items[index]).Plugin;

            bool rtsEnabled = myRealTimeStylus.Enabled;

            myRealTimeStylus.Enabled = false;
            myRealTimeStylus.SyncPluginCollection.Insert(insertAtIndex, plugin);
            myRealTimeStylus.Enabled = rtsEnabled;
        }
예제 #5
0
 /// <summary>
 /// Public constructor
 /// </summary>
 /// <param name="stylusPlugin">The plugin</param>
 /// <param name="pluginDescription">Description of the plugin</param>
 public PluginListItem(IStylusSyncPlugin stylusPlugin, [NotNull] string pluginDescription)
 {
     Plugin      = stylusPlugin;
     Description = pluginDescription ?? throw new ArgumentNullException(nameof(pluginDescription));
 }
 /// <summary>
 /// Public constructor
 /// </summary>
 /// <param name="Plugin">The plugin</param>
 /// <param name="description">Description of the plugin</param>
 public PluginListItem(IStylusSyncPlugin stylusPlugin, String pluginDescription)
 {
     Plugin = stylusPlugin;
     Description = pluginDescription;
 }
예제 #7
0
 /// <summary>
 /// Public constructor
 /// </summary>
 /// <param name="Plugin">The plugin</param>
 /// <param name="description">Description of the plugin</param>
 public PluginListItem(IStylusSyncPlugin stylusPlugin, String pluginDescription)
 {
     Plugin      = stylusPlugin;
     Description = pluginDescription;
 }