示例#1
0
        private bool ValidateWithAcknowlwdgement(string s, bool fo)                             // s => name of file/folder; (f == true) => folder, else file
        {
            string item = (fo?"folder":"file");

            if (!Valid(s))
            {
                Speak_Listen.StartPromptBuilder();
                Speak_Listen.AddPrompt("A " + item + " name can't contain any of these characters:");
                Speak_Listen.AddPrompt("Forward slash, Backslash, Pipe, Quote, Colon, Question Mark, Less Than, Greater Than, Asterisk");
                Speak_Listen.AddPrompt("A " + item + " can't contain only spaces. There has to be atleast one allowed character with space.");
                Speak_Listen.AddPrompt("Please type again");
                Speak_Listen.SpeakPrompt();
                TB1.Text = "";
                return(false);
            }
            if (fo)
            {
                return(true);
            }
            // Regular Expression (for File Format): Any name with atleast one letter in [a-z,A-Z,0-9] before "." and atleast one letter in [a-z,A-Z,0-9] after "."
            Regex regex = new Regex(@"^[a-zA-Z0-9]+\.[a-zA-Z0-9]+$");

            if (!regex.IsMatch(s))
            {
                Speak_Listen.Speak("File name can't be without an extension.");
                TB1.Text = "";
                return(false);
            }
            return(true);
        }
示例#2
0
        public void ReadOutControls(bool isBack, bool isNext, bool isUp, bool isDown, bool isFF, string ff)
        {
            Speak_Listen.StartPromptBuilder();
            if (isBack)
            {
                Speak_Listen.AddPrompt("Say Back to go back");
            }
            if (isNext)
            {
                Speak_Listen.AddPrompt("Say Next to go forward");
            }
            if (isUp)
            {
                Speak_Listen.AddPrompt("Say Up to move up the list");
            }
            if (isDown)
            {
                Speak_Listen.AddPrompt("Say Down to move down the list");
            }
            if (isFF)
            {
                Speak_Listen.AddPrompt("Say " + ff + " to dictate the " + ff);
            }

            Speak_Listen.AddPrompt("Say Refresh to refresh the list");
            Speak_Listen.AddPrompt("Say Read Out to dictate the list");
            Speak_Listen.AddPrompt("Say Controls to dictate the available controls");

            if (pD != null)
            {
                Speak_Listen.AddPrompt("Say Filter to filter the list");
            }

            Speak_Listen.SpeakPrompt();
        }
示例#3
0
        public void ReadOutListItems()
        {
            Speak_Listen.StartPromptBuilder();
            if (filter != "*")
            {
                string s = filter.Substring(1);
                if (isFolder != 0 && (isFolder == 1 || dirs.Count == 0))
                {
                    Speak_Listen.AddPrompt("This folder contains " + dirs.Count + " " + s + " folders and " + fileList.Count + " " + s + " files.");
                }
            }
            if (isFolder == 0)
            {
                if (filter == "*")
                {
                    Speak_Listen.AddPrompt("Sorry, this folder is empty");
                }
                else
                {
                    Speak_Listen.AddPrompt("Sorry, this folder has no " + filter.Substring(1) + " items");
                }
            }
            else
            {
                if (isFolder == 1)
                {
                    if (firstItemNo == 1 && filter == "*")
                    {
                        if (pD != null)
                        {
                            Speak_Listen.AddPrompt("There is a total of " + dirs.Count.ToString() + " folders and " + fileList.Count.ToString() + " files in this directory.");
                        }
                        else      // Indicates "This PC" part
                        {
                            Speak_Listen.AddPrompt("There is a total of " + (dirs.Count - 5).ToString() + " drives and 5 special folders in your Computer.");
                        }
                    }
                    if (pD != null)
                    {
                        Speak_Listen.AddPrompt("Here is the list of folders from " + firstItemNo.ToString() + " to " + lastItemNo.ToString());
                    }
                }
                else                                    // Files
                {
                    Speak_Listen.AddPrompt("Here is the list of files from " + firstItemNo.ToString() + " to " + lastItemNo.ToString());
                }

                int len = items.Count;
                for (int i = 1; i <= len; i++)
                {
                    Speak_Listen.AddPrompt("Number " + i.ToString() + ", " + items[i - 1].Folder);
                }
            }
            Speak_Listen.SpeakPrompt();
        }
示例#4
0
 private void ReadOutFilters()
 {
     Speak_Listen.StartPromptBuilder();
     for (int i = 1; i < 12; i++)
     {
         string s = ((ComboBoxItem)(DropDown.Items[i - 1])).Content.ToString();
         Speak_Listen.AddPrompt("Say " + (i.ToString()) + " to filter " + s);
     }
     Speak_Listen.AddPrompt("Say Repeat to repeat the list");
     Speak_Listen.SpeakPrompt();
 }