private void keylogger1_VKCodeAsStringDown(string value, bool isChar) { if (value.ToUpper() == keyWord.ToUpper()) { txtResources.Clear(); SetForegroundWindow(h); SendKeys.Send("^+4"); txtResources.Paste(); txtElements.Text += CreateElement.BuildElement(txtResources.Text.ToString()); txtAppName.Text = CreateElement.GetControlName(txtResources.Text.ToString()); } }
/// <summary> /// Initializes the AddIn Called by the AddIn loader after /// it has created the instance of this AddIn class /// </remarks> /// <param name="commandLine"></param> /// <returns>0 on success</returns> protected override int Run(string[] commandLine) { MSApp = Bentley.MicroStation.InteropServices.Utilities.ComApp; // MessageBox.Show("进入 ProgramTest! fullname: " + MSApp.FullName); CreateElement.LineAndLineString(null); // MessageBox.Show(@"运行完成"); // Register reload and unload events, and show the form ReloadEvent += new ReloadEventHandler(PowerCivilAddin1_ReloadEvent); UnloadedEvent += new UnloadedEventHandler(PowerCivilAddin1_UnloadedEvent); return 0; }
private void GridABMControls() { if (user.CanABMGrids()) { CreateElement gridScreenAdd = new CreateElement(this.user); ABMGridScreenModify gridScreenModify = new ABMGridScreenModify(this.user); ABMGridScreenDelete gridScreenDelete = new ABMGridScreenDelete(); gridABMNode.UserActions.Add(gridScreenAdd); gridABMNode.UserActions.Add(gridScreenModify); gridABMNode.UserActions.Add(gridScreenDelete); this.menuNodeList.Add(gridABMNode); } }
private void panel2_MouseClick(object sender, MouseEventArgs e) { //e. if (radioButton != null) { // Проверить на клик левой кнопкой //MessageBox.Show(radioButton.Tag.ToString()); string s = radioButton.Tag.ToString(); int n = Convert.ToInt16(s); CreateElement ce = ArrayCreate[n]; if (ce != null) { Element el = ce.Create(); Question q = (Question)Selection.SelectQuestion; q.Elements.Insert(0, el); el.CreateControl(); ElementControl elc = (ElementControl)el; elc.Location = e.Location;//new Point(e.X, e.Y); Control ccc = elc.CreateSubstrate(Selection, panel2); //((ElementControl)el).Location = new Point(e.X, e.Y); //Control ccc =((ElementControl)el).CreateSubstrate(Selection, panel2); Selection.ResetControl(ccc); Selection.BringToFront(); // Переместить этот элемент на нулевое место } // Создание объкта и установка его на панели } radioButtonPanel0.Checked = true; // Переход на нулевую кнопку }
public static IEnumerable <T> CollectSelectedElements <T>(GCRevitDocument doc, IsElement IsElem, CreateElement <T> CreateElement) { foreach (var id in doc.UIDocument.Selection.GetElementIds()) { var el = doc.Document.GetElement(id); if (IsElem(el)) { yield return(CreateElement(el)); } } }
public static IEnumerable <T> CollectAllElementsOfClass <T>(GCRevitDocument doc, Type type, IsElement IsElem, CreateElement <T> CreateElement) { var coll = new FilteredElementCollector(doc.Document).OfClass(type); foreach (var el in coll.ToElements()) { if (IsElem(el)) { yield return(CreateElement(el)); } } }
public static IEnumerable <T> CollectAllElementsOfCategory <T>(GCRevitDocument doc, BuiltInCategory categ, IsElement IsElem, CreateElement <T> CreateElement) { var coll = new FilteredElementCollector(doc.Document).OfCategory(categ); foreach (var el in coll.ToElements()) { if (IsElem(el)) { yield return(CreateElement(el)); } } }
private void StaticWeightedGenerator(CreateElement createElement, int weight) { for (int i = 0; i < weight; i++) { staticElementGenerators.Add(createElement); } }
private void AnimatedWeightedGenerator(CreateElement createElement, int weight) { for (int i = 0; i < weight; i++) { animatedElementGenerators.Add(createElement); } }