public static string GetPrimaryOutput(Project project, string ActiveConfigurationName, BIND_TYPE bindType) { VCProject vcProject = (VCProject)project.Object; if (vcProject != null) { IVCCollection configs = (IVCCollection)vcProject.Configurations; VCConfiguration config = (VCConfiguration)configs.Item(ActiveConfigurationName); switch( bindType ) { case BIND_TYPE.Application: if (config.ConfigurationType != Microsoft.VisualStudio.VCProjectEngine.ConfigurationTypes.typeApplication) return null; break; case BIND_TYPE.DynamicLibrary: if (config.ConfigurationType != Microsoft.VisualStudio.VCProjectEngine.ConfigurationTypes.typeDynamicLibrary) return null; break; } return config.PrimaryOutput; } return null; }
public TestRule(XmlNode node) { m_Name = node.Attributes.GetNamedItem("name").Value; m_SuiteType = (SUITE_TYPE)Enum.Parse( typeof(SUITE_TYPE), node.Attributes.GetNamedItem("suitetype").Value ); m_BindType = (BIND_TYPE)Enum.Parse( typeof(BIND_TYPE), node.Attributes.GetNamedItem("bindtype").Value ); XmlNodeList keywordList = node.SelectNodes("KeywordList/Keyword"); foreach (XmlNode keywordNode in keywordList) { TestKeyword keyword = new TestKeyword(keywordNode, m_SuiteType); m_Keywords.Add(keyword.Name, keyword); } }
public static void Bind(string FunctionName, string InputString) { BIND_TYPE Type = BIND_TYPE.SCANCODE; if (System.Array.IndexOf(MouseButtonList, InputString) >= 0) { Type = BIND_TYPE.MOUSEBUTTON; } if (System.Array.IndexOf(MouseWheelList, InputString) >= 0) { Type = BIND_TYPE.MOUSEWHEEL; } if (System.Array.IndexOf(AxisList, InputString) >= 0) { Type = BIND_TYPE.AXIS; } if (InputMap.HasAction(FunctionName)) { InputMap.EraseAction(FunctionName); foreach (BindingObject Bind in BindingList) { if (Bind.Name == FunctionName) { BindingList.Remove(Bind); break; } } } if (Type == BIND_TYPE.SCANCODE) { InputMap.AddAction(FunctionName); InputEventKey Event = new InputEventKey(); Event.Scancode = OS.FindScancodeFromString(InputString); InputMap.ActionAddEvent(FunctionName, Event); BindingList.Add(new BindingObject(FunctionName, Type)); } else if (Type == BIND_TYPE.MOUSEBUTTON) { InputMap.AddAction(FunctionName); InputEventMouseButton Event = new InputEventMouseButton(); switch (InputString) { case ("MouseOne"): Event.ButtonIndex = (int)ButtonList.Left; break; case ("MouseTwo"): Event.ButtonIndex = (int)ButtonList.Right; break; case ("MouseThree"): Event.ButtonIndex = (int)ButtonList.Middle; break; //No default as this else if will not run unless one of these string will match anyway } InputMap.ActionAddEvent(FunctionName, Event); BindingList.Add(new BindingObject(FunctionName, Type)); } else if (Type == BIND_TYPE.MOUSEWHEEL) { InputMap.AddAction(FunctionName); InputEventMouseButton Event = new InputEventMouseButton(); switch (InputString) { case ("WheelUp"): Event.ButtonIndex = (int)ButtonList.WheelUp; break; case ("WheelDown"): Event.ButtonIndex = (int)ButtonList.WheelDown; break; } InputMap.ActionAddEvent(FunctionName, Event); BindingList.Add(new BindingObject(FunctionName, Type)); } else if (Type == BIND_TYPE.AXIS) { InputMap.AddAction(FunctionName); InputEventMouseMotion Event = new InputEventMouseMotion(); InputMap.ActionAddEvent(FunctionName, Event); BindingObject Bind = new BindingObject(FunctionName, Type); switch (InputString) { case ("MouseUp"): Bind.AxisDirection = BindingObject.DIRECTION.UP; break; case ("MouseDown"): Bind.AxisDirection = BindingObject.DIRECTION.DOWN; break; case ("MouseRight"): Bind.AxisDirection = BindingObject.DIRECTION.RIGHT; break; case ("MouseLeft"): Bind.AxisDirection = BindingObject.DIRECTION.LEFT; break; } BindingList.Add(Bind); } }