Reflection .NET API
Attachmate.Reflection Assembly / Attachmate.Reflection.Productivity Namespace / IRecentTyping Interface / MinimumMatch Property
Example


In This Topic
    MinimumMatch Property (IRecentTyping)
    In This Topic
    Gets or sets the minimum length of words (in characters) that are added to Recent Typing.
    Syntax
    'Declaration
     
    
    Property MinimumMatch As Integer
    'Usage
     
    
    Dim instance As IRecentTyping
    Dim value As Integer
     
    instance.MinimumMatch = value
     
    value = instance.MinimumMatch
    int MinimumMatch {get; set;}
    Exceptions
    ExceptionDescription
    This exception is thrown if the set value is outside the valid range.
    This exception is thrown if you modify a Reflection property that's been secured via the Permissions Manager, or if such a modification requires Administrator privileges.
    Remarks
    The valid range of values is 1 - 100.
    Example
    This sample sets the MinimumMatch property to add only words with 5 or more characters to the Recent Typing list.
    using System;
    using System.Drawing;
    using System.Collections.Generic;
    using System.Text;
    using Attachmate.Reflection.Framework;
    using Attachmate.Reflection.Emulation.IbmHosts;
    using Attachmate.Reflection.UserInterface;
    using Attachmate.Reflection.Productivity;
    
    namespace ConfigureRecentTyping
    {
        class Program
        {
    
    
            static void Main(string[] args)
            {
                //Start a visible instance of Reflection or get the instance running at the given channel name
                Application app = MyReflection.CreateApplication("myWorkspace", true);
    
                //Create a terminal from the session document file
                string sessionPath = Environment.GetEnvironmentVariable("USERPROFILE") + @"\Documents\Micro Focus\Reflection\demoSession.rd3x";
                IIbmTerminal terminal = (IIbmTerminal)app.CreateControl(sessionPath);
    
                //Make the session visible in the workspace
                IFrame frame = (IFrame)app.GetObject("Frame");
                frame.CreateView(terminal);
    
                IIbmScreen screen = terminal.Screen;
    
                IProductivity productivityTools = terminal.Productivity;
    
                IRecentTyping typing = terminal.Productivity.RecentTyping;
    
                //Enable recent typing
                typing.Enabled = true;
    
                //Make the Recent Typing panel visible
                typing.RecentTypingPanelVisible = true;
    
                //Keep the list for the next session
                typing.ClearListOnDisconnect = false;
    
                //Set the minimum length, in characters, for words added to Recent Typing. 
                typing.MinimumMatch = 5;
    
                //Set the maximum number of items in the Recent Typing list. 
                typing.MaxListItems = 50;
           
                
                //Remove the user name from the list
                string uName = Environment.UserDomainName;
                typing.DeleteListItem(uName);
    
    
                //Add an item to the list
                typing.AddListItem("Kayak");
    
                typing.ListChanged += typing_ListChanged;
    
    
    
                Console.ReadLine();
            }
    
            static void typing_ListChanged(object sender, EventArgs e)
            {
                Console.WriteLine("list changed");
    
                IRecentTyping typing = (IRecentTyping)sender;
    
                string[] typingEntries = typing.RecentTypingCollection;
    
                
                //Check and remove sensitive entries
                for (int i = 0; i < typingEntries.Length; i++)
                {
                    if (typingEntries[i] == "SecretStuff") 
                    {
                        typing.DeleteListItem(i);
                    }
                }
            }
    
    
    
    
    
        }
    }
    
    
    
    
    
    
    
    
    
    
    
    See Also