public void AssignCameraPosition(int index) { switch (index) { case 0: currentCat = CategorySelection.none; break; case 1: currentCat = CategorySelection.primaryWeapon; break; case 2: currentCat = CategorySelection.secondaryWeapon; break; case 4: currentCat = CategorySelection.clothes; break; default: break; } camIndex = index; isLerping = true; isInit = false; }
public void OnClickItem() { if (OnItemClicked != null) { OnItemClicked(); } // TODO Load Different Items Into next selection System SetSelectionLevel(MenuSelectionLevel.Action); currentCategorySelection = CategorySelection.Item; }
public void OnClickSpecial() { if (OnSpecialClicked != null) { OnSpecialClicked(); } // TODO Load Different Specials Into next selection System SetSelectionLevel(MenuSelectionLevel.Action); currentCategorySelection = CategorySelection.Special; }
public void OnClickTactics() { if (OnTacticsClicked != null) { OnTacticsClicked(); } // TODO Load Different Tactics into next Selection System SetSelectionLevel(MenuSelectionLevel.Action); currentCategorySelection = CategorySelection.Tactics; }
public void OnClickAttack() { // TODO Hook player up to animations readying to fight if (OnAttackClicked != null) { OnAttackClicked(); } ActionSelectionPanel.LoadAttacks(currentFighter); SetSelectionLevel(MenuSelectionLevel.Action); currentCategorySelection = CategorySelection.Attack; }
private void OnEnable() { camera.position = cameraPositions[0].position; camera.rotation = cameraPositions[0].rotation; currentCat = CategorySelection.none; clothes = GameManagers.GetResourcesManager().GetAllClothItems(); weapons = GameManagers.GetResourcesManager().GetAllWeapons(); string modelId = GameManagers.GetProfile().modelId; string primaryWeapon = GameManagers.GetProfile().itemIds[0]; string secondaryWeapon = GameManagers.GetProfile().itemIds[1]; for (int i = 0; i < clothes.Count; i++) { if (string.Equals(clothes[i].name, modelId)) { clothIndex = i; break; } } for (int i = 0; i < weapons.Count; i++) { if (string.Equals(weapons[i].name, primaryWeapon)) { primaryWeaponIndex = i; break; } if (string.Equals(weapons[i].name, secondaryWeapon)) { secondaryWeaponIndex = i; break; } } offlineState.LoadCharacterModel(clothes[clothIndex].name); if (primaryWeaponObject != null) { Destroy(primaryWeaponObject); } primaryWeaponObject = CreateWeapon(weapons[primaryWeaponIndex], primaryWeaponParent); if (secondaryWeaponObject != null) { Destroy(secondaryWeaponObject); } secondaryWeaponObject = CreateWeapon(weapons[secondaryWeaponIndex], secondaryWeaponParent); }
/// <summary> /// Adds the pivot items for the unit categories. /// Create a new pivot item for each category, and a user control that will have /// the required two list boxes for each pivot item. /// </summary> /// <param name="view">The view.</param> private static void AddPivotItems(CategorySelection view) { foreach (CategoryInformation category in ApplicationState.SupportedConversions) { PivotItem p = new PivotItem(); TwoListBoxes l = new TwoListBoxes(); l.Name = "pivotItem" + category.CategoryLocalized; l.FromSelectionChanged += new SelectionChangedEventHandler(view.OnFromSelectionChanged); l.ToSelectionChanged += new SelectionChangedEventHandler(view.OnToSelectionChanged); p.Header = category.CategoryLocalized; p.Content = l; view.pivot.Items.Add(p); // Store the TwoListBoxes object in the category for later access category.PivotUnitSelect = l; category.PivotUnitSelect.toListView.ItemsSource = null; category.PivotUnitSelect.fromListView.ItemsSource = null; } }
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication application = commandData.get_Application(); Document document = application.get_ActiveUIDocument().get_Document(); UIDocument activeUIDocument = application.get_ActiveUIDocument(); Application application2 = commandData.get_Application().get_Application(); List <string> list = new List <string>(); foreach (Document document2 in application2.get_Documents()) { list.Add(document2.get_Title()); } GlobalVar.G_Doc_Selection = list; CategorySelection categorySelection = new CategorySelection(); categorySelection.InitializeComponent(commandData); categorySelection.ShowDialog(); List <Element> g_Ele = GlobalVar.G_Ele; List <string> g_Cat_Selection = GlobalVar.G_Cat_Selection; Document g_Sel_Doc = GlobalVar.G_Sel_Doc; if (g_Cat_Selection == null) { return(0); } List <ElementId> list2 = new List <ElementId>(); foreach (Element item in g_Ele) { foreach (string item2 in g_Cat_Selection) { if (item.get_Category().get_Name() == item2) { list2.Add(item.get_Category().get_Id()); } } } List <ElementId> cat_id = ((IEnumerable <ElementId>)list2).Distinct <ElementId>().ToList <ElementId>(); List <Element> list3 = Method.CategoryFilter(g_Sel_Doc, cat_id); WP_ProcessBar wP_ProcessBar = new WP_ProcessBar(g_Sel_Doc, list3, list3.Count); return(0); }
public void ClearCatergory(Hospital_Entity_Framework.Account acc, CategorySelection categorySelection) { var chk = _db.TempManagements.Where(v => v.Forms == "Medical's Form"); foreach (var item in chk.Where(v => v.Services == "Consultation")) { _db.TempManagements.Remove(item); } foreach (var item in chk.Where(v => v.Services == "Laboratory")) { _db.TempManagements.Remove(item); } foreach (var item in chk.Where(v => v.Services == "MedicalImaging")) { _db.TempManagements.Remove(item); } foreach (var item in chk.Where(v => v.Services == "Prescription")) { _db.TempManagements.Remove(item); } foreach (var item in chk.Where(v => v.Services == "VariousDocument")) { _db.TempManagements.Remove(item); } _db.SaveChanges(); categorySelection.tabCategory.Controls.Clear(); categorySelection.Account = _account; categorySelection.tabCategory.Controls.AddRange(new Control[] { TabConsultation(acc, categorySelection), TabLaboratory(acc, categorySelection), TabMedicalImaging(acc, categorySelection), TabPrescription(acc, categorySelection), TabVariousDocument(acc, categorySelection) }); }
internal void EditSkillSteps() { //Populate the Excel sheet Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "ShareSkill"); int excelRowToRead = 3; Title.Clear(); Title.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Title")); //Click on Description Description.Clear(); Description.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Description")); //Select A Category CategorySelection.Click(); String categoryValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Category"); IList <IWebElement> CategoriesDropDownList = CategorySelection.FindElements(By.XPath("//option")); int DpListCount = CategoriesDropDownList.Count; for (int i = 0; i < DpListCount; i++) { if (CategoriesDropDownList[i].Text == categoryValue) { CategoriesDropDownList[i].Click(); } } //Select Sub Category Thread.Sleep(1000); IWebElement SubCategorySelection = Global.GlobalDefinitions.driver.FindElement(By.Name("subcategoryId")); SubCategorySelection.Click(); String SubCategoryValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SubCategory"); IList <IWebElement> SubCategoriesDropDownList = SubCategorySelection.FindElements(By.XPath("//option")); int SbDpListCount = SubCategoriesDropDownList.Count; for (int i = 0; i < SbDpListCount; i++) { if (SubCategoriesDropDownList[i].Text == SubCategoryValue) { SubCategoriesDropDownList[i].Click(); } } //Clear and Add Tags IWebElement tagsInputBox = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[4]/div[2]/div")); IList <IWebElement> RemoveButtons = tagsInputBox.FindElements(By.ClassName("ReactTags__remove")); foreach (IWebElement element in RemoveButtons) { element.Click(); } Tags.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Tag")); Tags.SendKeys(Keys.Enter); //Select Service type String ServiceType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "ServiceType"); if (ServiceType.Equals("Hourly basis service")) { HourlyServiceType.Click(); } else if (ServiceType.Equals("One-off service")) { OneOffServiceType.Click(); } //Select Location type String LocationType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "LocationType"); if (ServiceType.Equals("On-site")) { OnsiteLocationType.Click(); } else if (ServiceType.Equals("Online")) { OnlineLocationType.Click(); } //Select Available Start date IWebElement AvailableStartDateInput = AvailabilityForm.FindElement(By.Name("startDate")); //AvailableStartDateInput.Clear(); AvailableStartDateInput.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableStartDate")); //Select Available End date IWebElement AvailableEndDateInput = AvailabilityForm.FindElement(By.Name("endDate")); AvailableEndDateInput.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableEndDate")); String[] WeekDays = new String[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; //clear Selected Checkboxes IList <IWebElement> AvailableCheckboxes = AvailabilityForm.FindElements(By.Name("Available")); foreach (IWebElement element in AvailableCheckboxes) { if (element.Selected) { element.Click(); } } //Select Checkboxes based on data String AvailableDaysValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableDays"); IList <String> AvailableDays = AvailableDaysValue.Split(','); for (int i = 0; i < WeekDays.Count(); i++) { if (AvailableDays.Contains(WeekDays[i])) { AvailableCheckboxes[i].Click(); } } //Set Start times IList <IWebElement> AvailableStartTimeInputs = AvailabilityForm.FindElements(By.Name("StartTime")); String AvailableStartTimesValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableStartTimes"); IList <String> AvailableStartTimes = AvailableStartTimesValue.Split(','); for (int i = 0; i < AvailableStartTimes.Count(); i++) { IList <String> startTimeInfo = AvailableStartTimes[i].Split(':'); String startTimeDay = startTimeInfo[0]; String startTimeValue = startTimeInfo[1]; int indexOfDay = Array.IndexOf(WeekDays, startTimeDay); AvailableStartTimeInputs[indexOfDay].SendKeys(startTimeValue); } //Set End times IList <IWebElement> AvailableEndTimeInputs = AvailabilityForm.FindElements(By.Name("EndTime")); String AvailableEndTimesValue = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "AvailableEndTimes"); IList <String> AvailableEndTimes = AvailableEndTimesValue.Split(','); for (int i = 0; i < AvailableEndTimes.Count(); i++) { IList <String> endTimeInfo = AvailableEndTimes[i].Split(':'); String endTimeDay = endTimeInfo[0]; String endTimeValue = endTimeInfo[1]; int indexOfDay = Array.IndexOf(WeekDays, endTimeDay); AvailableEndTimeInputs[indexOfDay].SendKeys(endTimeValue); } //Select Skill Exchange Type String SkillTradeType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SkillTradeType"); if (SkillTradeType.Equals("Skill-exchange")) { SkillExchangeType.Click(); //Clear and Add Tags IWebElement SkillTagsInputBox = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[8]/div[4]/div/div")); IList <IWebElement> CrossButtons = SkillTagsInputBox.FindElements(By.ClassName("ReactTags__remove")); foreach (IWebElement element in CrossButtons) { element.Click(); } SkillExchangeTag.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "SkillExchangeTab")); SkillExchangeTag.SendKeys(Keys.Enter); } else if (SkillTradeType.Equals("Credit")) { CreditsType.Click(); CreditsAmount.Clear(); CreditsAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "CreditsAmount")); } //Select Active Status Button String ActiveType = Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "ActiveType"); if (SkillTradeType.Equals("Active")) { ActiveButton.Click(); } else if (SkillTradeType.Equals("Hidden")) { HiddenButton.Click(); } //Click on Save Button SaveButton.Click(); Thread.Sleep(3000); //Verify IWebElement listingTable = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table")); IList <IWebElement> tableRows = listingTable.FindElements(By.TagName("tr")); Boolean isListingEdited = false; for (int i = 0; i <= tableRows.Count; i++) { IWebElement row = tableRows[i]; if (row.Text.Contains(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Title")) && row.Text.Contains(Global.GlobalDefinitions.ExcelLib.ReadData(excelRowToRead, "Description"))) { isListingEdited = true; break; } } if (isListingEdited == true) { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Edit Skill test Successful"); } else { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Edit Skill test Failed"); } }
public void Awake() { thisManager = this; }
/// <summary> /// Setup the required data object to be able to data bind to the list views in the /// pivot control /// </summary> /// <param name="view">View </param> internal static void InitializeCategoryBinding(CategorySelection view) { AddPivotItems(view); }
public void SubmitCategory(Hospital_Entity_Framework.Account acc, CategorySelection categorySelection) { DeleteCategory(acc); var getTemp = _db.TempManagements.Where(v => v.WorkerId == acc.WorkerId && v.Forms == "Medical's Form"); var getManagement = _db.Managements.First(v => v.AccountId == acc.Id); var getItem = _db.Forms.First(v => v.Name == "Medical's Form"); getManagement.Forms.Add(getItem); foreach (var itemTemp in getTemp) { if (itemTemp.Services == "Consultation") { var get = Convert.ToInt32(itemTemp.Categorys); var chk = _db.ConsultationCategories.First(v => v.Id == get); getManagement.ConsultationCategories.Add(chk); } if (itemTemp.Services == "Laboratory") { var get = Convert.ToInt32(itemTemp.Categorys); var chk = _db.LaboratoryCategories.First(v => v.Id == get); getManagement.LaboratoryCategories.Add(chk); } if (itemTemp.Services == "MedicalImaging") { var get = Convert.ToInt32(itemTemp.Categorys); var chk = _db.MedicalImagingCategories.First(v => v.Id == get); getManagement.MedicalImagingCategories.Add(chk); } if (itemTemp.Services == "Prescription") { var get = Convert.ToInt32(itemTemp.Categorys); var chk = _db.PrescriptionCategories.First(v => v.Id == get); getManagement.PrescriptionCategories.Add(chk); } if (itemTemp.Services == "VariousDocument") { var get = Convert.ToInt32(itemTemp.Categorys); var chk = _db.VariousDocumentCategories.First(v => v.Id == get); getManagement.VariousDocumentCategories.Add(chk); } if (itemTemp.Services == "Medical's Form") { var get = Convert.ToInt32(itemTemp.Categorys); var chk = _db.Forms.First(v => v.Id == get); getManagement.Forms.Add(chk); } } _db.SaveChanges(); categorySelection.tabCategory.Controls.Clear(); categorySelection.Account = _account; categorySelection.tabCategory.Controls.AddRange(new Control[] { TabConsultation(acc, categorySelection), TabLaboratory(acc, categorySelection), TabMedicalImaging(acc, categorySelection), TabPrescription(acc, categorySelection), TabVariousDocument(acc, categorySelection) }); categorySelection.tabCategory.Enabled = false; categorySelection.tabCategory.SelectTab("Consultation"); categorySelection.tabCategory.Enabled = true; }
public TabPage TabConsultation(Hospital_Entity_Framework.Account acc, CategorySelection categorySelection) { var tab = new TabPage() { AutoScroll = true, Text = @"Consultation", Name = @"Consultation" }; var flpn = new FlowLayoutPanel() { Dock = DockStyle.Fill, AutoScroll = true }; flpn.Controls.Clear(); _categorySelection = null; _categorySelection = categorySelection; _account = acc; var chkMedicalForm = _db.TempManagements.Where(v => v.WorkerId == acc.WorkerId) .Any(v => v.Forms == "Medical's Form"); if (chkMedicalForm) { var getTemp = _db.TempManagements.Where(v => v.Forms == "Medical's Form").Where(v => v.Services == "Consultation"); var getCategory = _db.ConsultationCategories; foreach (var itemCategory in getCategory) { if (getTemp.Any(v => v.Categorys == itemCategory.Id.ToString())) { var dic = new Dictionary <int, string> { { acc.WorkerId, "Consultation" } }; var btn = new Button { Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.LimeGreen, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += RemoveCategory_Click; } else { var dic = new Dictionary <int, string> { { acc.WorkerId, "Consultation" } }; var btn = new Button { Location = new Point(3, 3), Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.Khaki, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += TakeCategory_Click; } } } else { var getManagement = _db.Managements.Any(v => v.AccountId == acc.Id); if (getManagement) { var getCategoryforManagement = _db.Managements.First(v => v.AccountId == acc.Id); if (getCategoryforManagement.ConsultationCategories != null) { foreach (var item in getCategoryforManagement.ConsultationCategories.ToList()) { var insertTemp = new TempManagement() { WorkerId = acc.WorkerId, Forms = "Medical's Form", Services = "Consultation", Categorys = item.Id.ToString() }; _db.TempManagements.Add(insertTemp); } } if (getCategoryforManagement.LaboratoryCategories != null) { foreach (var item in getCategoryforManagement.LaboratoryCategories.ToList()) { var insertTemp = new TempManagement() { WorkerId = acc.WorkerId, Forms = "Medical's Form", Services = "Laboratory", Categorys = item.Id.ToString() }; _db.TempManagements.Add(insertTemp); } } if (getCategoryforManagement.MedicalImagingCategories != null) { foreach (var item in getCategoryforManagement.MedicalImagingCategories.ToList()) { var insertTemp = new TempManagement() { WorkerId = acc.WorkerId, Forms = "Medical's Form", Services = "MedicalImaging", Categorys = item.Id.ToString() }; _db.TempManagements.Add(insertTemp); } } if (getCategoryforManagement.PrescriptionCategories != null) { foreach (var item in getCategoryforManagement.PrescriptionCategories.ToList()) { var insertTemp = new TempManagement() { WorkerId = acc.WorkerId, Forms = "Medical's Form", Services = "Prescription", Categorys = item.Id.ToString() }; _db.TempManagements.Add(insertTemp); } } if (getCategoryforManagement.VariousDocumentCategories != null) { foreach (var item in getCategoryforManagement.VariousDocumentCategories.ToList()) { var insertTemp = new TempManagement() { WorkerId = acc.WorkerId, Forms = "Medical's Form", Services = "VariousDocument", Categorys = item.Id.ToString() }; _db.TempManagements.Add(insertTemp); } } _db.SaveChanges(); var getTemp = _db.TempManagements.Where(v => v.Forms == "Medical's Form").Where(v => v.Services == "Consultation"); var getCategory = _db.ConsultationCategories; foreach (var itemCategory in getCategory) { if (getTemp.Any(v => v.Categorys == itemCategory.Id.ToString())) { var dic = new Dictionary <int, string> { { acc.WorkerId, "Consultation" } }; var btn = new Button { Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.LimeGreen, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += RemoveCategory_Click; } else { var dic = new Dictionary <int, string> { { acc.WorkerId, "Consultation" } }; var btn = new Button { Location = new Point(3, 3), Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.Khaki, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += TakeCategory_Click; } } } else { var create = new Hospital_Entity_Framework.Management() { AccountId = acc.Id }; _db.Managements.Add(create); _db.SaveChanges(); var getTemp = _db.TempManagements.Where(v => v.Forms == "Medical's Form").Where(v => v.Services == "Consultation"); var getCategory = _db.ConsultationCategories; foreach (var itemCategory in getCategory) { if (getTemp.Any(v => v.Categorys == itemCategory.Id.ToString())) { var dic = new Dictionary <int, string> { { acc.WorkerId, "Consultation" } }; var btn = new Button { Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.LimeGreen, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += RemoveCategory_Click; } else { var dic = new Dictionary <int, string> { { acc.WorkerId, "Consultation" } }; var btn = new Button { Location = new Point(3, 3), Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.Khaki, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += TakeCategory_Click; } } } } tab.Controls.Add(flpn); return(tab); }
public virtual Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) GlobalVar.G_commandData = commandData; UIApplication application = commandData.get_Application(); Document document = application.get_ActiveUIDocument().get_Document(); UIDocument activeUIDocument = application.get_ActiveUIDocument(); Application application2 = commandData.get_Application().get_Application(); View activeView = document.get_ActiveView(); GlobalVar.TypeORInstance = "Family Instance"; Selection selection = application.get_ActiveUIDocument().get_Selection(); ICollection <ElementId> elementIds = selection.GetElementIds(); List <Element> list = new List <Element>(); foreach (ElementId item in elementIds) { Element element = document.GetElement(item); list.Add(element); } if (list.Count > 0) { DataSet dataSet = new DataSet(); DataSet dataSet2 = new DataSet(); List <ElementId> list2 = new List <ElementId>(); foreach (Element item2 in list) { try { list2.Add(item2.get_Category().get_Id()); } catch { MessageBox.Show("None Category Instance Is Not Support.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } List <ElementId> list3 = ((IEnumerable <ElementId>)list2).Distinct <ElementId>().ToList <ElementId>(); if (list3.Count == 0) { return(0); } foreach (ElementId item3 in list3) { FilteredElementCollector val = new FilteredElementCollector(document, elementIds).OfCategoryId(item3); IList <Element> eleList = val.ToElements(); DataTable table = Method.ElementParameter2Table(commandData, eleList); DataTable table2 = Method.ParameterIsRead(commandData, eleList, document); dataSet.Tables.Add(table); dataSet2.Tables.Add(table2); } ParameterEventHandler parameterEventHandler = new ParameterEventHandler(); ElementOverrideEventHandler elementOverrideEventHandler = new ElementOverrideEventHandler(); ResetElementOverrideEventHandler resetElementOverrideEventHandler = new ResetElementOverrideEventHandler(); ExternalEvent g_exEvent = ExternalEvent.Create(parameterEventHandler); ExternalEvent g_exEvent2 = ExternalEvent.Create(elementOverrideEventHandler); ExternalEvent g_exEvent3 = ExternalEvent.Create(resetElementOverrideEventHandler); GlobalVar.G_handler = parameterEventHandler; GlobalVar.G_exEvent = g_exEvent; GlobalVar.G_handler1 = elementOverrideEventHandler; GlobalVar.G_exEvent1 = g_exEvent2; GlobalVar.G_handler3 = resetElementOverrideEventHandler; GlobalVar.G_exEvent3 = g_exEvent3; GlobalVar.MyDataSet = dataSet; GlobalVar.Is_Read_Only = dataSet2; HotGear_Parameter_Explorer hotGear_Parameter_Explorer = new HotGear_Parameter_Explorer(); hotGear_Parameter_Explorer.InitializeComponent(commandData, document); hotGear_Parameter_Explorer.Show(); } else { List <string> list4 = new List <string>(); foreach (Document document2 in application2.get_Documents()) { list4.Add(document2.get_Title()); } GlobalVar.G_Doc_Selection = list4; CategorySelection categorySelection = new CategorySelection(); categorySelection.InitializeComponent(commandData); categorySelection.ShowDialog(); List <Element> g_Ele = GlobalVar.G_Ele; List <string> g_Cat_Selection = GlobalVar.G_Cat_Selection; Document g_Sel_Doc = GlobalVar.G_Sel_Doc; ICollection <ElementId> g_Eleid = GlobalVar.G_Eleid; if (g_Cat_Selection == null) { return(0); } DataSet dataSet3 = new DataSet(); DataSet dataSet4 = new DataSet(); List <ElementId> list5 = new List <ElementId>(); foreach (Element item4 in g_Ele) { foreach (string item5 in g_Cat_Selection) { if (item4.get_Category().get_Name() == item5) { list5.Add(item4.get_Category().get_Id()); } } } List <ElementId> list6 = ((IEnumerable <ElementId>)list5).Distinct <ElementId>().ToList <ElementId>(); if (list6.Count == 0) { return(0); } foreach (ElementId item6 in list6) { FilteredElementCollector val3 = new FilteredElementCollector(g_Sel_Doc, g_Eleid).OfCategoryId(item6); IList <Element> eleList2 = val3.ToElements(); DataTable table3 = Method.ElementParameter2Table(commandData, eleList2); DataTable table4 = Method.ParameterIsRead(commandData, eleList2, g_Sel_Doc); dataSet3.Tables.Add(table3); dataSet4.Tables.Add(table4); } ParameterEventHandler parameterEventHandler2 = new ParameterEventHandler(); ElementOverrideEventHandler elementOverrideEventHandler2 = new ElementOverrideEventHandler(); ResetElementOverrideEventHandler resetElementOverrideEventHandler2 = new ResetElementOverrideEventHandler(); ExternalEvent g_exEvent4 = ExternalEvent.Create(parameterEventHandler2); ExternalEvent g_exEvent5 = ExternalEvent.Create(elementOverrideEventHandler2); ExternalEvent g_exEvent6 = ExternalEvent.Create(resetElementOverrideEventHandler2); GlobalVar.G_handler = parameterEventHandler2; GlobalVar.G_exEvent = g_exEvent4; GlobalVar.G_handler1 = elementOverrideEventHandler2; GlobalVar.G_exEvent1 = g_exEvent5; GlobalVar.G_handler3 = resetElementOverrideEventHandler2; GlobalVar.G_exEvent3 = g_exEvent6; GlobalVar.MyDataSet = dataSet3; GlobalVar.Is_Read_Only = dataSet4; HotGear_Parameter_Explorer hotGear_Parameter_Explorer2 = new HotGear_Parameter_Explorer(); hotGear_Parameter_Explorer2.InitializeComponent(commandData, g_Sel_Doc); hotGear_Parameter_Explorer2.Show(); } return(0); }
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) UIApplication application = commandData.get_Application(); Document document = application.get_ActiveUIDocument().get_Document(); UIDocument activeUIDocument = application.get_ActiveUIDocument(); Application application2 = commandData.get_Application().get_Application(); List <string> list = new List <string>(); foreach (Document document2 in application2.get_Documents()) { list.Add(document2.get_Title()); } GlobalVar.G_Doc_Selection = list; CategorySelection categorySelection = new CategorySelection(); categorySelection.InitializeComponent(commandData); categorySelection.ShowDialog(); List <Family> g_Ele = GlobalVar.G_Ele; List <string> g_Cat_Selection = GlobalVar.G_Cat_Selection; string g_Path = GlobalVar.G_Path; Document g_Sel_Doc = GlobalVar.G_Sel_Doc; if (g_Cat_Selection == null) { return(0); } List <ElementId> list2 = new List <ElementId>(); foreach (Family item in g_Ele) { foreach (string item2 in g_Cat_Selection) { if (item.get_FamilyCategory().get_Name() == item2) { list2.Add(item.get_FamilyCategory().get_Id()); } } } List <ElementId> cat_id = ((IEnumerable <ElementId>)list2).Distinct <ElementId>().ToList <ElementId>(); List <Family> list3 = Method.CategoryFilter(g_Sel_Doc, cat_id); int count = list3.Count; WP_ProcessBar wP_ProcessBar = new WP_ProcessBar(g_Sel_Doc, g_Path, list3, count); return(0); }
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) GlobalVar.G_commandData = commandData; UIApplication application = commandData.get_Application(); Document document = application.get_ActiveUIDocument().get_Document(); UIDocument activeUIDocument = application.get_ActiveUIDocument(); Application application2 = commandData.get_Application().get_Application(); View activeView = document.get_ActiveView(); GlobalVar.TypeORInstance = "Family Type"; Selection selection = application.get_ActiveUIDocument().get_Selection(); ICollection <ElementId> elementIds = selection.GetElementIds(); ICollection <ElementId> collection = new List <ElementId>(); List <Element> list = new List <Element>(); foreach (ElementId item in elementIds) { try { Element element = document.GetElement(item); ElementId typeId = element.GetTypeId(); Element element2 = document.GetElement(typeId); collection.Add(typeId); list.Add(element2); } catch { } } if (list.Count > 0) { DataSet dataSet = new DataSet(); DataSet dataSet2 = new DataSet(); List <ElementId> list2 = new List <ElementId>(); foreach (Element item2 in list) { try { list2.Add(item2.get_Category().get_Id()); } catch { } } List <ElementId> list3 = ((IEnumerable <ElementId>)list2).Distinct <ElementId>().ToList <ElementId>(); foreach (ElementId item3 in list3) { FilteredElementCollector val = new FilteredElementCollector(document, collection).OfCategoryId(item3); IList <Element> eleList = val.ToElements(); DataTable table = Method.ElementParameter2Table(commandData, eleList); DataTable table2 = Method.ParameterIsRead(commandData, eleList, document); dataSet.Tables.Add(table); dataSet2.Tables.Add(table2); } ParameterEventHandler parameterEventHandler = new ParameterEventHandler(); ElementOverrideEventHandler elementOverrideEventHandler = new ElementOverrideEventHandler(); ResetElementOverrideEventHandler resetElementOverrideEventHandler = new ResetElementOverrideEventHandler(); ExternalEvent g_exEvent = ExternalEvent.Create(parameterEventHandler); ExternalEvent g_exEvent2 = ExternalEvent.Create(elementOverrideEventHandler); ExternalEvent g_exEvent3 = ExternalEvent.Create(resetElementOverrideEventHandler); GlobalVar.G_handler = parameterEventHandler; GlobalVar.G_exEvent = g_exEvent; GlobalVar.G_handler1 = elementOverrideEventHandler; GlobalVar.G_exEvent1 = g_exEvent2; GlobalVar.G_handler3 = resetElementOverrideEventHandler; GlobalVar.G_exEvent3 = g_exEvent3; GlobalVar.MyDataSet = dataSet; GlobalVar.Is_Read_Only = dataSet2; HotGear_Parameter_Explorer hotGear_Parameter_Explorer = new HotGear_Parameter_Explorer(); hotGear_Parameter_Explorer.InitializeComponent(commandData, document); hotGear_Parameter_Explorer.Show(); } else { List <string> list4 = new List <string>(); foreach (Document document2 in application2.get_Documents()) { list4.Add(document2.get_Title()); } GlobalVar.G_Doc_Selection = list4; CategorySelection categorySelection = new CategorySelection(); categorySelection.InitializeComponent(commandData); categorySelection.ShowDialog(); List <Element> g_Ele = GlobalVar.G_Ele; List <string> g_Cat_Selection = GlobalVar.G_Cat_Selection; Document g_Sel_Doc = GlobalVar.G_Sel_Doc; ICollection <ElementId> g_Eleid = GlobalVar.G_Eleid; if (g_Cat_Selection == null) { return(0); } List <ElementId> list5 = new List <ElementId>(); foreach (Element item4 in g_Ele) { foreach (string item5 in g_Cat_Selection) { if (item4.get_Category().get_Name() == item5) { list5.Add(item4.get_Category().get_Id()); } } } DataSet dataSet3 = new DataSet(); DataSet dataSet4 = new DataSet(); List <ElementId> list6 = ((IEnumerable <ElementId>)list5).Distinct <ElementId>().ToList <ElementId>(); foreach (ElementId item6 in list6) { FilteredElementCollector val3 = new FilteredElementCollector(g_Sel_Doc, g_Eleid).OfCategoryId(item6); IList <Element> list7 = new List <Element>(); foreach (Element item7 in val3) { list7.Add(item7); } DataTable table3 = Method.ElementParameter2Table(commandData, list7); DataTable table4 = Method.ParameterIsRead(commandData, list7, g_Sel_Doc); dataSet3.Tables.Add(table3); dataSet4.Tables.Add(table4); } ParameterEventHandler parameterEventHandler2 = new ParameterEventHandler(); ElementOverrideEventHandler elementOverrideEventHandler2 = new ElementOverrideEventHandler(); ResetElementOverrideEventHandler resetElementOverrideEventHandler2 = new ResetElementOverrideEventHandler(); ExternalEvent g_exEvent4 = ExternalEvent.Create(parameterEventHandler2); ExternalEvent g_exEvent5 = ExternalEvent.Create(elementOverrideEventHandler2); ExternalEvent g_exEvent6 = ExternalEvent.Create(resetElementOverrideEventHandler2); GlobalVar.G_handler = parameterEventHandler2; GlobalVar.G_exEvent = g_exEvent4; GlobalVar.G_handler1 = elementOverrideEventHandler2; GlobalVar.G_exEvent1 = g_exEvent5; GlobalVar.G_handler3 = resetElementOverrideEventHandler2; GlobalVar.G_exEvent3 = g_exEvent6; GlobalVar.MyDataSet = dataSet3; GlobalVar.Is_Read_Only = dataSet4; HotGear_Parameter_Explorer hotGear_Parameter_Explorer2 = new HotGear_Parameter_Explorer(); hotGear_Parameter_Explorer2.InitializeComponent(commandData, g_Sel_Doc); hotGear_Parameter_Explorer2.Show(); } return(0); }
public TabPage TabVariousDocument(Hospital_Entity_Framework.Account acc, CategorySelection categorySelection) { var tab = new TabPage() { AutoScroll = true, Text = @"VariousDocument", Name = @"VariousDocument" }; var flpn = new FlowLayoutPanel() { Dock = DockStyle.Fill, AutoScroll = true }; flpn.Controls.Clear(); _categorySelection = null; _categorySelection = categorySelection; _account = acc; var getTemp = _db.TempManagements.Where(v => v.Forms == "Medical's Form").Where(v => v.Services == "VariousDocument"); var getCategory = _db.VariousDocumentCategories; foreach (var itemCategory in getCategory) { if (getTemp.Any(v => v.Categorys == itemCategory.Id.ToString())) { var dic = new Dictionary <int, string> { { acc.WorkerId, "VariousDocument" } }; var btn = new Button { Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.LimeGreen, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += RemoveCategory_Click; } else { var dic = new Dictionary <int, string> { { acc.WorkerId, "VariousDocument" } }; var btn = new Button { Location = new Point(3, 3), Size = new Size(180, 90), Text = itemCategory.Name, Name = itemCategory.Id.ToString(), BackColor = Color.Khaki, Font = new Font("November", 12), Tag = dic }; flpn.Controls.Add(btn); btn.Click += TakeCategory_Click; } } tab.Controls.Add(flpn); return(tab); }