コード例 #1
0
            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();
            }
コード例 #2
0
            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);
                }
            }
コード例 #3
0
            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;
            }
コード例 #4
0
            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;
            }
コード例 #5
0
ファイル: FileDialog.cs プロジェクト: mleo1/sharpshell
        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);
        }