private void MovePlace(int fromIndex, int toIndex) { FileDialogPlaceBase place = (FileDialogPlaceBase)placesListBox.Items[fromIndex]; ToolStripItem placeButton = placesBar.Items[fromIndex]; m_places.RemoveAt(fromIndex); placesBar.Items.RemoveAt(fromIndex); m_places.Insert(toIndex, place); placesBar.Items.Insert(toIndex, placeButton); ((CurrencyManager)placesListBox.BindingContext[m_places]).Refresh(); }
private void selectedPlaceProps_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { FileDialogPlaceBase place = (FileDialogPlaceBase)placesListBox.SelectedItem; ((CurrencyManager)placesListBox.BindingContext[m_places]).Refresh(); bool multipleLines; ToolStripButton placeButton = (ToolStripButton)placesBar.Items[placesListBox.SelectedIndex]; placeButton.Text = FileDialog.InsertLineBreaks(place.Text, out multipleLines); placeButton.Padding = new Padding(0, multipleLines ? 3 : 8, 0, multipleLines ? 0 : 8); if (e.ChangedItem.Label == "Path") { placeButton.Image = ShellImageList.GetImage(place.PIDL); } }
private void AddPlace(FileDialogPlaceBase place) { m_places.Add(place); ((CurrencyManager)placesListBox.BindingContext[m_places]).Refresh(); bool multipleLines; ToolStripButton placeButton = new ToolStripButton(FileDialog.InsertLineBreaks(place.Text, out multipleLines)); placeButton.Image = ShellImageList.GetImage(place.PIDL); placeButton.ImageAlign = ContentAlignment.BottomCenter; placeButton.Margin = new Padding(1, 0, 0, 0); placeButton.Padding = new Padding(0, multipleLines ? 3 : 8, 0, multipleLines ? 0 : 8); placeButton.Tag = place; placeButton.TextImageRelation = TextImageRelation.ImageAboveText; placesBar.Items.Add(placeButton); placesListBox.ClearSelected(); placesListBox.SelectedIndex = placesListBox.Items.Count - 1; }
private void AddItem(FileDialogPlaceBase place) { bool multipleLines; ToolStripButton placeButton = new ToolStripButton(InsertLineBreaks(place.Text, out multipleLines), ShellImageList.GetImage(place.PIDL)); placeButton.Tag = place.PIDL; placeButton.Margin = new Padding(1, 0, 0, 0); placeButton.Padding = new Padding(0, multipleLines ? 3 : 8, 0, multipleLines ? 0 : 8); placeButton.ImageAlign = ContentAlignment.BottomCenter; placeButton.TextImageRelation = TextImageRelation.ImageAboveText; placesBar.Items.Add(placeButton); }