//private void ExecuteSearchStartedCommand(object arg) //{ // if (arg is FunctionEventArgs<string> e) // { // var query = e.Info; // //bool subItemContains = false; // if (!string.IsNullOrWhiteSpace(query)) // { // if (AccordionItems.Count == 0) // { // AccordionItems.Filter = null; // } // else // { // // filters the itemcollection, if an item's header doesn't match with the query, it gets filtered out. // AccordionItems.Filter = item => // { // //SfAccordionItem accordionItem = item as SfAccordionItem; // if (item == null) // return false; // return (item as SfAccordionItem).Header.ToString().ToLower().Contains(query.ToLower()); // //subProperties = GetPropertyViews(accordionItem); // //// filters the subCategories aswell based on the Category string. // //subProperties.Filter = subItem => // //{ // // PropertyCategoryViewItemCollection viewItemCollection = subItem as PropertyCategoryViewItemCollection; // // subItemContains = viewItemCollection.Category.ToLower().Contains(query.ToLower()); // // return subItemContains; // //}; // //// If theres still an element in the collection after the filter, // //// then we still allow the current accordionItem to be shown. // //if (subProperties.Count > 0) // // return true; // //return headerContains; // }; // } // } // reseting filter. // else // if the search bar gets emptied out, then all items should be seen again by removing the filter. // { // AccordionItems.Filter = null; // } // } //} // Starting from the AccordionItem, this method recurseviley goes down the visual tree // until it finds the element with the PropertyView type. private ItemCollection GetPropertyViews(DependencyObject currentElement) { int childCount = VisualTreeHelper.GetChildrenCount(currentElement); ItemCollection foundCollection = null; for (int i = 0; i < childCount; i++) { var child = VisualTreeHelper.GetChild(currentElement, i); PropertyView childType = child as PropertyView; if (childType == null) { foundCollection = GetPropertyViews(child); if (foundCollection != null) { break; } } else { foundCollection = (child as PropertyView).Items; break; } } return(foundCollection); }
/// <summary> /// /// </summary> /// <param name="action"></param> private void SelectView(string action) { PropertyView newView = null; switch (action) { case "Source Properties": newView = new SourceView(this._component); break; case "Code Expression Repository": newView = new ExpressionRepositoryView(this._component, true); break; case "Equation Repository": newView = new EquationRepositoryView(this._component, true); break; case "Destination Properties": newView = new DestinationView3D(this._component); break; } this.rightpanel.Controls.Add(newView); newView.Dock = DockStyle.Fill; if (_currentView != null) { _currentView.SaveData(); _currentView.Dispose(); _currentView = null; } _currentView = newView; _currentView.OnViewStatusChange += new ViewStatusChangeHandler(_currentView_OnViewStatusChange); }
public PropertyView GetPropertyViewById(int id) { using (SqlConnection connection = new SqlConnection(CommonUtility.ConnectionString)) { SqlCommand command = new SqlCommand(StoreProcedure.GETPROPERTYDETAILSBYID, connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@PropertyId", id)); try { connection.Open(); SqlDataReader reader = command.ExecuteReader(); PropertyView propertyDetails = new PropertyView(); propertyDetails = UtilityManager.DataReaderMap <PropertyView>(reader); return(propertyDetails); } catch (Exception e) { throw new Exception("Exception retrieving reviews. " + e.Message); } finally { connection.Close(); } } }
public ActionResult ClientReview(ClientViewModel clientVwModel, PropertyView propertyView) { clientVwModel.PropertyRating.ClientId = (long)Session["ClientId"]; clientVwModel.PropertyRating.PropertyId = propertyView.PropertyId; clientVwModel.PropertyRating.CreatedDate = DateTime.Now; PropertyRatingManager.InsertPropertyRating(clientVwModel.PropertyRating); return(RedirectToAction("OfficeDetails/" + propertyView.PropertyId)); }
private void PropertyGrid_Loaded(object sender, RoutedEventArgs e) { PropertyView item1 = VisualUtils.FindDescendant(this, typeof(PropertyView)) as PropertyView; if (item1 != null) { item1.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged; } }
private void btClose_Click(object sender, System.EventArgs e) { if (_currentView != null) { _currentView.SaveData(); _currentView.Dispose(); _currentView = null; } this.Close(); }
public void AllViewElementsAreInitialized() { PropertyView view = new PropertyView(); foreach (PropertyInfo prop in typeof(PropertyView).GetProperties()) { if (typeof(IViewElement).IsAssignableFrom(prop.PropertyType)) { if (prop.GetValue(view, new object[0]) == null) Assert.Fail("{0} was not initialized", prop.Name); } } }
public PropertyViewModel() { Title = "Свойства"; Name = "СвойстваName"; ContentId = Guid.Parse("e2b0173c-84d4-4ef4-ad37-087aed6cf359"); CanClose = true; IsClosed = false; PropertyView propertyView = new PropertyView(); propertyView.DataContext = this; UserInterface = propertyView; }
public void AllViewElementsAreInitialized() { PropertyView view = new PropertyView(); foreach (PropertyInfo prop in typeof(PropertyView).GetProperties()) { if (typeof(IViewElement).IsAssignableFrom(prop.PropertyType)) { if (prop.GetValue(view, new object[0]) == null) { Assert.Fail("{0} was not initialized", prop.Name); } } } }
//Delete Property English public ActionResult Delete(string pacelNumber, string titleNumber, bool isSaved) { CreateCompanyContractEng contract = new CreateCompanyContractEng(); if (Session["Property"] != null) { contract.HypothecatedProperty = (List <PropertyView>)Session["Property"]; } PropertyView _propertyView = contract.HypothecatedProperty.Where(c => c.Pacelnumber.Equals(pacelNumber) && c.TitleNumber.Equals(titleNumber)) .FirstOrDefault(); contract.HypothecatedProperty.Remove(_propertyView); Session["Property"] = contract.HypothecatedProperty; return(PartialView("_CreatePropertyEng", contract.HypothecatedProperty)); }
public ActionResult DeleteNew(string pacelNumber, string titleNumber, bool isSaved) { CreateDecide contract = new CreateDecide(); if (Session["NewProperty"] != null) { contract.NewProperty = (List <PropertyView>)Session["NewProperty"]; } PropertyView _propertyView = contract.NewProperty.Where(c => c.Pacelnumber.Equals(pacelNumber) && c.TitleNumber.Equals(titleNumber)) .FirstOrDefault(); contract.NewProperty.Remove(_propertyView); Session["NewProperty"] = contract.NewProperty; return(PartialView("_NewPropertyView", contract.NewProperty)); }
private void OnGUI() { // Check for null views if (PropertyView == null || WorkView == null) { CreateViews(); } // Get and process the current event Event e = Event.current; ProcessEvents(e); // Update WorkView.UpdateView(position, new Rect(0f, 0f, ViewPercentage, 1f), e, CurrentGraph); PropertyView.UpdateView(new Rect(position.width, position.y, position.width, position.height), new Rect(ViewPercentage, 0f, 1f - ViewPercentage, 1f), e, CurrentGraph); Repaint(); }
public void Handle(BookViewCommand command) { var property = _context.Properties.Find(command.PropertyId); var propertyView = new PropertyView { BuyerId = command.BuyerId, Date = command.Date, PropertyId = command.PropertyId }; if (property.Views == null) { property.Views = new List <PropertyView>(); } property.Views.Add(propertyView); _context.SaveChanges(); }
public WrappedProperty(MemberDescriptor descr, PropertyView propertyView, Attribute[] attrs) : base(descr, attrs) { this.realPropertyDescriptor = (PropertyDescriptor)descr; this.name = propertyView.Name; this.displayName = propertyView.DisplayName; Attribute[] attribs = new Attribute[descr.Attributes.Count + 4]; int i = 0; foreach (Attribute attrib in descr.Attributes) { attribs[i] = attrib; i++; } attribs[i] = new DescriptionAttribute(propertyView.Description); attribs[i + 1] = new CategoryAttribute(propertyView.Category); attribs[i + 2] = new DescriptionAttribute(propertyView.Description); attribs[i + 3] = new ReadOnlyAttribute(propertyView.IsReadOnly); attributes = new AttributeCollection(attribs); }
private void initControls() { toolBar = new ToolBarStrip(); statBar = new WhiskeyStatusBar(); menu = new WhiskeyMenu(); mainPanel = new Panel(); mainPanel.Padding = new Padding(0, menu.Height + toolBar.Height, 0, statBar.Height); propView = new PropertyView(); propView.Name = "Properties"; propViewDock = new DockControl(mainPanel, DockStyle.Right); propViewDock.Name = UIManager.VIEW_NAME_PROPERTIES; propViewDock.PrimaryView = propView; outputView = new OutputView(); outputView.Name = "Output"; outputViewDock = new DockControl(mainPanel, DockStyle.Bottom); outputViewDock.Name = UIManager.VIEW_NAME_OUTPUT; outputViewDock.PrimaryView = outputView; libraryView = new LibraryView(); libraryView.Name = "Library"; libraryViewDock = new DockControl(mainPanel, DockStyle.Left); libraryViewDock.Name = UIManager.VIEW_NAME_LIBRARY; libraryViewDock.PrimaryView = libraryView; docView = new DocumentView(); UIManager.Instance.setDocumentView(docView); docView.Name = "Documents"; docViewDock = new DockControl(mainPanel, DockStyle.Fill); docViewDock.Name = UIManager.VIEW_NAME_DOCUMENTS; docViewDock.PrimaryView = docView; }
/// <summary> /// Get properties from selected category when creating new good /// </summary> /// <param name="category">selected category</param> /// <returns></returns> public JsonResult GetProperties(string category) { var properties = _unitOfWork.Properties.GetAllByCategoryName(category); var propList = new List <PropertyView>(); foreach (var prop in properties) { var p = new PropertyView { Id = prop.Id, Name = prop.Name, Specifications = new List <SpecificationView>() }; prop.Specifications.ForEach(s => p.Specifications.Add(new SpecificationView { Id = s.Id, Name = s.Name })); propList.Add(p); } return(Json(propList, JsonRequestBehavior.AllowGet)); }
//Filling DataGridView private void FillDataGrid() { //dgvProps.Items.Clear(); foreach (Property item in db.Properties.ToList()) { PropertyView obj = new PropertyView { Id = item.Id, StatusType = item.Status.StatusName, AdvertType = item.Advert_Type.Name, PropertyType = item.Propert_Type.Name, RoomCount = item.Room_Count.RoomCount, City = item.City.CityName, Region = item.Region.RegionName, Settlement = item.Settlement.Name, Country = item.Country.Name, DocumentType = item.Document_Type.Name, RepairType = item.Repair_Type.Name, SellType = item.Sell_Type.Name, Metro = item.Metro.MetroName, OwnerType = item.Owner_Type.TypeName, FloorCount = item.Floor_Count.FloorCount, ConstProject = item.Constructor_Project.ProjectName, Adress = item.Adress, Price = (int)item.Price, About = item.About, OwnerName = item.OwnerName, OwnerNumber = item.OwnerNumber, OwnerEmail = item.OwnerEmail, OwnerAbout = item.OwnerAbout, Area = (decimal)item.Area, Floor = item.Floor.ToString(), LandArea = (decimal)item.LandArea }; dgvProps.Items.Add(obj); } }
public ActionResult OfficeDetails(BookingEmail bookingEmail, PropertyView propertyView, string address, string area, string city, string zipCode) { long bookingId = 0; long propertyId = propertyView.PropertyId; try { if (!ModelState.IsValid) { string password = string.Empty; long clientId = _checkExclient(bookingEmail.Email.Trim()); if (clientId == 0) { password = UtilityManager.RandomString(5); clientId = _insertClient(bookingEmail, password); } string bookingNo = "SS" + UtilityManager.RandomString(5); bookingId = _insertBooking(bookingEmail, clientId, propertyId, bookingNo); //_sendEmail(bookingEmail, propertyId, bookingNo, address, area, city, zipCode, password); } } catch (Exception ex) { if (Request.UrlReferrer != null) { return(Redirect(Request.UrlReferrer.PathAndQuery)); } } // return RedirectToAction("BookingConfirmed"); return(RedirectToAction("BookingConfirmed", new { PropertyId = propertyId, BookingId = bookingId })); }
// SELECTING DATAGRID ROW private void dgvProps_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e) { PropertyView prop = dgvProps.CurrentItem as PropertyView; selected = db.Properties.Find(prop.Id); cmbStatusType.Text = selected.StatusId + "-" + selected.Status.StatusName; cmbAdvertType.Text = selected.AdvertTypeId + "-" + selected.Advert_Type.Name; cmbPropertyType.Text = selected.PropertyTypeId + "-" + selected.Propert_Type.Name; cmbCities.Text = selected.CityId + "-" + selected.City.CityName; new TextRange(rtbAdress.Document.ContentStart, rtbAdress.Document.ContentEnd).Text = selected.Adress; cmbRegions.Text = selected.RegionId + "-" + selected.Region.RegionName; cmbSettlement.Text = selected.SettlementId + "-" + selected.Settlement.Name; cmbMetro.Text = selected.MetroId + "-" + selected.Metro.MetroName; cmbOwnerType.Text = selected.OwnerTypeId + "-" + selected.Owner_Type.TypeName; cmbCountry.Text = selected.CountryId + "-" + selected.Country.Name; cmbFloorCount.Text = selected.Floor_Count.FloorCount; cmbFloor.Text = selected.Floor.ToString(); cmbRoomCount.Text = selected.Room_Count.RoomCount; txtArea.Text = selected.Area.ToString(); txtPrice.Text = selected.Price.ToString(); cmbDocumentType.Text = selected.DocumentTypeId + "-" + selected.Document_Type.Name; new TextRange(rtbAbout.Document.ContentStart, rtbAbout.Document.ContentEnd).Text = selected.About; cmbConstProject.Text = selected.ConstProjectId + "-" + selected.Constructor_Project.ProjectName; cmbRepairType.Text = selected.RepairTypeId + "-" + selected.Repair_Type.Name; txtLandArea.Text = selected.LandArea.ToString(); cmbSellType.Text = selected.SellTypeId + "-" + selected.Sell_Type.Name; txtOwnerName.Text = selected.OwnerName; txtOwnerNumber.Text = selected.OwnerNumber; txtOwnerEmail.Text = selected.OwnerEmail; txtOwnerAbout.Text = selected.OwnerAbout; btnAdd.Visibility = Visibility.Hidden; btnUpdate.Visibility = Visibility.Visible; btnDelete.Visibility = Visibility.Visible; }
internal Property(PropertyView owner) { m_owner = owner; }
/// <summary> /// Constructor</summary> /// <param name="owner">PropertyView of category owner</param> public Category(PropertyView owner) { m_owner = owner; }
private void OnSelectedNodeChanged() { PropertyView?.ShowProperties(SelectedNode, -1); RenderView?.SelectPalette(SelectedNode); DisplayItems(); }
private void OnSelectedItemChanged() { HierarchyView.ShowCurrentSelection(); PropertyView?.ShowProperties(SelectedNode, SelectedItemIndex); RenderView?.SelectObject(SelectedNode, SelectedItemIndex); }
public ActionResult Create(PropertyView model) { if (ModelState.IsValid) { int dId = AdminService.AddDetails(model.Details.Price, model.Details.SpaceM2, model.Details.MoreDetails, model.Details.RoomsId, model.Property.ID); int aId = AdminService.AddAddress(model.Address.City, model.Address.Street, model.Address.Block, model.Address.Apartment); // TODO:add status bool isSavedSuccessfully = true; string fName = ""; try { foreach (string fileName in Request.Files) { HttpPostedFileBase file = Request.Files[fileName]; //Save file content goes here fName = file.FileName; if (file != null && file.ContentLength > 0) { var originalDirectory = new DirectoryInfo(string.Format("{0}Images\\WallImages", Server.MapPath(@"\"))); string pathString = System.IO.Path.Combine(originalDirectory.ToString(), "imagepath"); var fileName1 = Path.GetFileName(file.FileName); bool isExists = System.IO.Directory.Exists(pathString); if (!isExists) { System.IO.Directory.CreateDirectory(pathString); } var path = string.Format("{0}\\{1}", pathString, file.FileName); file.SaveAs(path); int pId = AdminService.AddPhoto(path); AdminService.AddProperty(model.Property.Name, aId, dId, pId); } } } catch (Exception ex) { isSavedSuccessfully = false; } if (isSavedSuccessfully) { return(View("Index")); } else { return(Json(new { Message = "Error in saving file" })); } } return(View("Index")); }
public async Task <ActionResult> CreateProperty(PropertyView model) { if (ModelState.IsValid && model.SellerSigniture) { try { var config = new MapperConfiguration(cfg => { cfg.CreateMap <PropertyView, Property>(); }); IMapper mapper = config.CreateMapper(); Property NewProp = mapper.Map <PropertyView, Property>(model); NewProp.SellerID = User.Identity.GetUserId(); if (NewProp.TitleDeedPath == "") { NewProp.TitleDeedPath = "N/A"; } if (NewProp.BedRooms == null) { NewProp.BedRooms = 0; } if (NewProp.FloorSize == null) { NewProp.FloorSize = 0; } if (NewProp.YardSize == null) { NewProp.YardSize = 0; } if (NewProp.Reserve == null) { NewProp.Reserve = 0; } if (NewProp.Garages == null) { NewProp.Garages = 0; } if (NewProp.OpeningBid == null) { NewProp.OpeningBid = 0; } if (NewProp.TaxesAndRate == null) { NewProp.TaxesAndRate = 0; } if (NewProp.levies == null) { NewProp.levies = 0; } NewProp.MandateSingedDate = DateTime.Now; NewProp.MandateExpireDate = DateTime.Now.AddDays(90); NewProp.TaxesAndRates = FileController.PostFile(model.TaxesAndRates, "TaxesAndRates", "TaxesAndRates"); NewProp.PlansPath = FileController.PostFile(model.PlansPath, "Plans", "Plans"); // NewProp.TitleDeedPath = FileController.PostFile(model.TitleDeedPath, "Titledeeds", "Titledeeds"); NewProp.HOARules = FileController.PostFile(model.HOARules, "HOARules", "HOARules"); //Call Post Method Property ob = APIMethods.APIPost <Property>(NewProp, "Properties"); SendGridService ser = new SendGridService(); /*EmailMessageInfo msg = new EmailMessageInfo() { * FromEmailAddress = "*****@*****.**", * ToEmailAddress = model.Seller.SellerEmail, * EmailSubject ="New Property listing.", * EmailBody = "Property: Title-"+model.Title+"/n Address- "+model.Address+"/n Youre listing will be reviewed and you will be notified Accordingly." * }; * // await ser.Send(msg); * * EmailMessageInfo msgAdmin = new EmailMessageInfo() { * FromEmailAddress = "*****@*****.**", * ToEmailAddress = model.Seller.SellerEmail, * EmailSubject ="New Property listing.", * EmailBody = "Property: Title-"+model.Title+"/n Address- "+model.Address+"./n Property listed by "+model.Seller.FirtstName+" "+model.Seller.LastName * }; * await ser.Send(msgAdmin);*/ return(RedirectToAction("AddPhoto", new { id = ob.PropertyID })); } catch (Exception E) { throw new Exception(E.Message); } } else { return(View(model)); } }
public virtual ActionResult ShowDetailProperty(int id) { var datetime = DateTime.Now; if (_db.PropertyViews.Any(a => a.HomePropertyID == id)) { var propertyView = _db.PropertyViews.Where(a => a.HomePropertyID == id).OrderByDescending(a => a.PropertyViewID).FirstOrDefault(); if (propertyView != null) { _db.Entry(propertyView).State = EntityState.Modified; var date = propertyView.PropertyViewDate.Date; var now = datetime.Date; if (date == now) { propertyView.PropertyViewCount = propertyView.PropertyViewCount + 1; _db.SaveChanges(); } else { var viewProperty = new PropertyView() { HomePropertyID = id, PropertyViewDate = datetime, PropertyViewCount = 1, StringDate = datetime.Year + "/" + datetime.Month + "/" + datetime.Day }; _db.PropertyViews.Add(viewProperty); _db.SaveChanges(); } } } else { var viewProperty = new PropertyView() { HomePropertyID = id, PropertyViewDate = datetime, PropertyViewCount = 1, StringDate = datetime.Year + "/" + datetime.Month + "/" + datetime.Day }; _db.PropertyViews.Add(viewProperty); _db.SaveChanges(); } var homeProperty = _db.HomeProperties.SingleOrDefault(a => a.HomePropertyID == id); if (homeProperty != null) { if (homeProperty.HomeProperties_MetaData.Any(a => a.FacilityID != null)) { ViewBag.facility = homeProperty.HomeProperties_MetaData.Where(a => a.FacilityID != null).ToList(); } if (homeProperty.HomeProperties_MetaData.Any(a => a.ConditionID != null)) { ViewBag.condition = homeProperty.HomeProperties_MetaData.Where(a => a.ConditionID != null).ToList(); } return(View(homeProperty)); } else { return(RedirectToAction("Index", "Home")); } }
private void btnFind_Click(object sender, EventArgs e) { switch (comboTypes.SelectedIndex) { case 0: // Persons Person p = this.Program.Find(new Person(textSearch.Text)); if (p == null) { goto Error; } PersonView pv = new PersonView(p, this); pv.onDispose += (person) => { p = person; }; pv.ShowDialog(); goto Finish; case 1: // Cadastral Area CadastralArea c = null; if (Int32.TryParse(textSearch.Text, out int search)) { c = new CadastralArea(search); c = this.Program.Find(new CadastralAreaByID(new CadastralArea(search))); } else { c = new CadastralArea(0, textSearch.Text); c = this.Program.Find(new CadastralAreaByName(c)); } if (c == null) { goto Error; } CadastralView cv = new CadastralView(c); cv.onDispose += (cArea, oldName) => { if (oldName != c.Name) { this.Program.UpdateCadastralArea(c, oldName); } }; cv.ShowDialog(); goto Finish; case 2: // Property list InputDialog id = new InputDialog("Catastral area:"); id.onDispose += (caId) => { if (caId != "") { CadastralArea ca = null; if (Int32.TryParse(caId, out int s)) { ca = this.Program.Find(new CadastralAreaByID(new CadastralArea(s, ""))); } else { ca = this.Program.Find(new CadastralAreaByName(new CadastralArea(0, caId))); } if (ca != null) { PropertyList pl = ca.FindPropertyList(textSearch.Text); if (pl == null) { MessageBox.Show("Property list with this id does not exist"); } else { PropertyListView plv = new PropertyListView(pl, this); plv.ShowDialog(); } } else { MessageBox.Show("Cadastral area with this id/name does not exist"); } } else { MessageBox.Show("You have to write something"); } }; id.ShowDialog(); goto Finish; case 3: // Property InputDialog id2 = new InputDialog("Catastral area:"); id2.onDispose += (caId) => { if (caId != "") { CadastralArea ca = null; if (Int32.TryParse(caId, out int s)) { ca = this.Program.Find(new CadastralAreaByID(new CadastralArea(s, ""))); } else { ca = this.Program.Find(new CadastralAreaByName(new CadastralArea(0, caId))); } if (ca != null) { Property prop = ca.FindProperty(textSearch.Text); if (prop == null) { MessageBox.Show("Property with this id does not exist"); } else { PropertyView propv = new PropertyView(prop); propv.ShowDialog(); } } else { MessageBox.Show("Cadastral area with this id/name does not exist"); } } else { MessageBox.Show("You have to write something"); } }; id2.ShowDialog(); goto Finish; } Error: MessageBox.Show("Could not find specified item"); Finish :; }
public MainForm() { InitializeComponent(); IsMdiContainer = true; PluginManager.Init(); OpenTKResources.Init(); _nodePropertyViewer = new PropertyView(); _nodePropertyViewer.Dock = DockStyle.Fill; _nodePropertyViewer.Show(dockPanel); //dockPanel.ShowDocumentIcon = true; dockPanel.ActiveContentChanged += (sender, args) => { if (dockPanel.ActiveContent != null) { LastActiveContent = dockPanel.ActiveContent; } }; Viewport = new CommonViewport(); Viewport.Dock = DockStyle.Fill; Viewport.Show(dockPanel); //_ScriptEditor = new SubactionEditor(); //_ScriptEditor.Dock = DockStyle.Fill; ImageList myImageList = new ImageList(); myImageList.ImageSize = new System.Drawing.Size(24, 24); myImageList.Images.Add("unknown", Properties.Resources.ico_unknown); myImageList.Images.Add("known", Properties.Resources.ico_known); myImageList.Images.Add("folder", Properties.Resources.ico_folder); myImageList.Images.Add("group", Properties.Resources.ico_group); myImageList.Images.Add("table", Properties.Resources.ico_table); myImageList.Images.Add("jobj", Properties.Resources.ico_jobj); myImageList.Images.Add("dobj", Properties.Resources.ico_dobj); myImageList.Images.Add("pobj", Properties.Resources.ico_pobj); myImageList.Images.Add("mobj", Properties.Resources.ico_mobj); myImageList.Images.Add("tobj", Properties.Resources.ico_tobj); myImageList.Images.Add("aobj", Properties.Resources.ico_aobj); myImageList.Images.Add("cobj", Properties.Resources.ico_cobj); myImageList.Images.Add("fobj", Properties.Resources.ico_fobj); myImageList.Images.Add("iobj", Properties.Resources.ico_iobj); myImageList.Images.Add("lobj", Properties.Resources.ico_lobj); myImageList.Images.Add("sobj", Properties.Resources.ico_sobj); myImageList.Images.Add("coll", Properties.Resources.ico_coll); myImageList.Images.Add("anim_texture", Properties.Resources.ico_anim_texture); myImageList.Images.Add("anim_material", Properties.Resources.ico_anim_material); myImageList.Images.Add("anim_joint", Properties.Resources.ico_anim_joint); myImageList.Images.Add("anim_shape", Properties.Resources.ico_anim_shape); myImageList.Images.Add("kabii", Properties.Resources.ico_kabii); myImageList.Images.Add("fuma", Properties.Resources.ico_fuma); treeView1.ImageList = myImageList; bool dc = false; treeView1.MouseDown += (sender, args) => { dc = args.Clicks > 1; }; treeView1.BeforeExpand += (sender, args) => { args.Cancel = dc; if (args.Node is DataNode node && Instance.IsOpened(node) && !dc) { MessageBox.Show("Error: This node is currently open in an editor\nPlease close it first to expand"); args.Cancel = true; } dc = false; }; treeView1.AfterExpand += (sender, args) => { args.Node.Nodes.Clear(); treeView1.BeginUpdate(); if (args.Node is DataNode node) { node.ExpandData(); } treeView1.EndUpdate(); }; treeView1.AfterCollapse += (sender, args) => { treeView1.BeginUpdate(); args.Node.Nodes.Clear(); args.Node.Nodes.Add(new TreeNode()); treeView1.EndUpdate(); }; treeView1.AfterSelect += (sender, args) => { SelectNode <HSDAccessor>(); }; treeView1.NodeMouseClick += (sender, args) => { treeView1.SelectedNode = treeView1.GetNodeAt(args.Location); if (args.Button == MouseButtons.Right && args.Node != null && args.Node is DataNode node) { PluginManager.GetContextMenuFromType(node.Accessor.GetType()).Show(this, args.Location); } try { var kb = OpenTK.Input.Keyboard.GetState(); if (kb.IsKeyDown(OpenTK.Input.Key.ShiftLeft) || kb.IsKeyDown(OpenTK.Input.Key.ShiftRight)) { treeView1.BeginUpdate(); treeView1.SelectedNode.ExpandAll(); treeView1.EndUpdate(); } } catch (Exception) { } }; }
private void configPropertyView(PropertyView propView) { Columns[propView.Name].DisplayIndex = propView.Position; Columns[propView.Name].HeaderText = propView.DisplayName; Columns[propView.Name].Width = propView.Length; }