public void Update() //UID2139429132 { this.width = 0; this.height = 0; this.isVisible = false; if (this.diagramView.layersHistory != null && this.diagramView.layersHistory.Count > 1) { this.items.Clear(); long i = 0; foreach (Layer layer in this.diagramView.layersHistory) { //skip first top layer because logo is showed insted if (i++ == 0) { continue; } BreadcrumbItem item = new BreadcrumbItem(); if (layer.parentNode != null) { item.name = layer.parentNode.name; } else { item.name = "Home"; } if (item.name.Length > 10) { item.name = item.name.Substring(0, 9); } SizeF s = Fonts.MeasureString(item.name, this.font); item.left = this.width; item.top = 0; item.height = (int)s.Height; item.width = (int)s.Width; this.width += item.width + itemSpace; if (this.height < item.height) { this.height = item.height; } item.layerId = layer.id; // for restore layer after click this.items.Add(item); } // add logo width this.width += this.height; // add logo width to items foreach (BreadcrumbItem item in items) { item.left += this.height; } this.isVisible = true; } }
public void Update() { this.width = 0; this.height = 0; this.isVisible = false; if (this.diagramView.layersHistory != null && this.diagramView.layersHistory.Count > 1) { this.items.Clear(); int i = 0; foreach (Layer layer in this.diagramView.layersHistory) { //skip first top layer because logo is showed insted if (i++ == 0) continue; BreadcrumbItem item = new BreadcrumbItem(); if (layer.parentNode != null) { item.name = layer.parentNode.name; } else { item.name = "Home"; } if (item.name.Length > 10) { item.name = item.name.Substring(0, 9); } SizeF s = Fonts.MeasureString(item.name, this.font); item.left = this.width; item.top = 0; item.height = (int)s.Height; item.width = (int)s.Width; this.width += item.width + itemSpace; if (this.height < item.height) { this.height = item.height; } item.layerId = layer.id; // for restore layer after click this.items.Add(item); } // add logo width this.width += this.height; // add logo width to items foreach (BreadcrumbItem item in items) { item.left += this.height; } this.isVisible = true; } }