// called when a new group is set up, what editor do you want? and you can alter the condition // for new entries, cd = AlwaysTrue. For older entries, the condition private ActionPackEditBase SetPackEditorAndCondition(string group, Condition cd) { if (group == "Voice") { ActionPackEditVoice ev = new ActionPackEditVoice(); ev.Height = 28; ev.onEditKeys = onEditKeys; ev.onEditSay = onEditSay; // make sure the voice condition is right.. if not, reset. if (cd.eventname != Actions.ActionEventEDList.onVoiceInput.TriggerName || (!cd.Is("VoiceInput", ConditionEntry.MatchType.MatchSemicolonList) && !cd.Is("VoiceInput", ConditionEntry.MatchType.MatchSemicolon))) { cd.eventname = Actions.ActionEventEDList.onVoiceInput.TriggerName; cd.Set(new ConditionEntry("VoiceInput", ConditionEntry.MatchType.MatchSemicolonList, "?")); // Voiceinput being the variable set to the expression } return(ev); } else { ActionPackEditEventProgramCondition eb = new ActionPackEditEventProgramCondition(); eb.autosetcondition += SetEventCondition; eb.Height = 28; eb.onEditKeys = onEditKeys; eb.onEditSay = onEditSay; return(eb); } }
// called when a new group is set up, what editor do you want? and you can alter the condition // for new entries, cd = AlwaysTrue. For older entries, the condition private ActionPackEditBase SetPackEditorAndCondition(string group, Condition cd) { List <string> addnames = new List <string>() { "{one}", "{two}" }; if (group == "Voice") { ActionPackEditVoice ev = new ActionPackEditVoice(); ev.Height = 28; ev.onEditKeys = onEditKeys; ev.onEditSay = onEditSay; // make sure the voice condition is right.. if not, reset. if (cd.eventname != Actions.ActionEventEDList.onVoiceInput.triggername || !cd.Is("VoiceInput", ConditionEntry.MatchType.Equals)) { cd.eventname = Actions.ActionEventEDList.onVoiceInput.triggername; cd.Set(new ConditionEntry("VoiceInput", ConditionEntry.MatchType.Equals, "?")); // Voiceinput being the variable set to the expression } return(ev); } else { ActionPackEditEventProgramCondition eb = new ActionPackEditEventProgramCondition(); eb.autosetcondition += SetEventCondition; eb.Height = 28; eb.onEditKeys = onEditKeys; eb.onEditSay = onEditSay; return(eb); } }