Exemplo n.º 1
0
 public TestEditor()
 {
     InitializeComponent();
     _reportEntries      = new List <ReportEntry>();
     _listViewItemSorter = new ListViewItemSorter();
     lvwListOfTest.ListViewItemSorter = _listViewItemSorter;
 }
Exemplo n.º 2
0
        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/
        public find_form2(gvt_lib lib, GvoDatabase db, spot _spot, item_window _item_window)
        {
            m_lib         = lib;
            m_db          = db;
            m_spot        = _spot;
            m_item_window = _item_window;
            m_gpos        = new Point(-1, -1);

            m_sorter = new ListViewItemSorter();

            InitializeComponent();

            Useful.SetFontMeiryo(this, def.MEIRYO_POINT);

            m_now_find = false;

            // tooltip
            toolTip1.AutoPopDelay = 30 * 1000;                                  // 30秒表示
            toolTip1.BackColor    = Color.LightYellow;

            // 各ページの初期化
            init_page1();
            init_page2();
            init_page3();
        }
Exemplo n.º 3
0
        /*-------------------------------------------------------------------------
         *
         * ---------------------------------------------------------------------------*/
        public share_routes_form(List <ShareRoutes.ShareShip> list)
        {
            m_sorter            = new ListViewItemSorter();
            m_selected_position = new Point(-1, -1);

            InitializeComponent();
            Useful.SetFontMeiryo(this, def.MEIRYO_POINT);

            label2.Text = String.Format("{0}인", list.Count);

            listView1.FullRowSelect = true;
            listView1.GridLines     = true;

            listView1.Columns.Add("이름", 150);
            listView1.Columns.Add("장소", 100);
            listView1.Columns.Add("상태", 100);

            foreach (ShareRoutes.ShareShip s in list)
            {
                ListViewItem item = new ListViewItem(s.Name, 0);
                item.SubItems.Add(String.Format("{0},{1}", s.Position.X, s.Position.Y));
                if (s.State == ShareRoutes.State.in_the_sea)
                {
                    item.SubItems.Add("항해중");
                }
                else
                {
                    item.SubItems.Add("정박중");
                }
                listView1.Items.Add(item);
            }
        }
Exemplo n.º 4
0
        public void GetSortColumnReturns1()
        {
            var listViewItemSorter = new ListViewItemSorter();

            listViewItemSorter.SortColumn = 1;
            Assert.AreEqual(1, listViewItemSorter.SortColumn);
        }
Exemplo n.º 5
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public SearchFileForm()
        {
            InitializeComponent();

            // リストビューのソートに関する設定
            listViewFileNameSorter = new ListViewItemSorter();
            listViewFileNameSorter.Column = 2;
            listViewFileNameSorter.SortOrder = SortOrder.Ascending;
            IComparer<string> ignoreCaseComparer = new StringComparer(false);
            IComparer<string> ignoreCaseDirectoryComparer = new DirectoryComparer(false);
            listViewFileNameSorter.Comparers.Add(ignoreCaseComparer);
            listViewFileNameSorter.Comparers.Add(ignoreCaseComparer);
            listViewFileNameSorter.Comparers.Add(ignoreCaseDirectoryComparer);
            listViewFileName.ListViewItemSorter = listViewFileNameSorter;
            listViewFileName.SetHeaderSortArrowStyle(
                listViewFileNameSorter.Column,
                SelectHeaderSortArrows(listViewFileNameSorter.SortOrder));

            // 検索ディレクトリにシステムディレクトリのルートディレクトリを設定する
            string systemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);

            if (!string.IsNullOrEmpty(systemPath))
            {
                textDirectory.Text = Path.GetPathRoot(systemPath);
            }
        }
Exemplo n.º 6
0
        public void CompareReturnsNegative1()
        {
            var listViewItemSorter = new ListViewItemSorter();
            var listViewItem1      = new ListViewItem("A");
            var listViewItem2      = new ListViewItem("B");

            var actual = listViewItemSorter.Compare(listViewItem1, listViewItem2);

            Assert.AreEqual(-1, actual);
        }
Exemplo n.º 7
0
        public void CompareReturnsPositive1()
        {
            var listViewItemSorter = new ListViewItemSorter();

            listViewItemSorter.SortOrder = SortOrder.Descending;
            var listViewItem1 = new ListViewItem("A");
            var listViewItem2 = new ListViewItem("B");

            var actual = listViewItemSorter.Compare(listViewItem1, listViewItem2);

            Assert.AreEqual(1, actual);
        }
Exemplo n.º 8
0
        public ResourceList(ResourceEditorControl editor)
        {
            name.Text  = ResourceService.GetString("Global.Name");
            name.Width = 250;

            type.Text  = ResourceService.GetString("ResourceEditor.ResourceEdit.TypeColumn");
            type.Width = 170;

            content.Text  = ResourceService.GetString("ResourceEditor.ResourceEdit.ContentColumn");
            content.Width = 300;

            comment.Text  = ResourceService.GetString("ResourceEditor.ResourceEdit.CommentColumn");
            comment.Width = 300;

            Columns.AddRange(new ColumnHeader[] { name, type, content, comment });

            FullRowSelect = true;
            AutoArrange   = true;
            Alignment     = ListViewAlignment.Left;
            View          = View.Details;
            GridLines     = true;
            LabelEdit     = true;
            Dock          = DockStyle.Fill;
            HideSelection = false;

            BorderStyle = System.Windows.Forms.BorderStyle.None;

            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.string"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bmp"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.icon"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.cursor"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.bin"));
            images.Images.Add(WinFormsResourceService.GetIcon("Icons.16x16.ResourceEditor.obj"));
            SmallImageList = images;

            // Set up sorting:
            // User can sort the list by name and by type,
            // whereas sorting by type also implicitly sorts by name.
            IListViewItemComparer textComparer     = new ListViewTextColumnComparer();
            IListViewItemComparer typeNameComparer = new ListViewMultipleColumnsComparer(textComparer, 1, textComparer, 0);

            sorter = new ListViewItemSorter(this,
                                            new IListViewItemComparer[] {
                textComparer,
                typeNameComparer,
                null,
                null
            });
            sorter.SortColumnIndex = 0;
            sorter.SortOrder       = SortOrder.Ascending;

            ContextMenuStrip = MenuService.CreateContextMenu(editor, "/SharpDevelop/ResourceEditor/ResourceList/ContextMenu");
        }
Exemplo n.º 9
0
 protected override void Dispose(bool disposing)
 {
     try {
         if (disposing)
         {
             if (sorter != null)
             {
                 sorter.Dispose();
                 sorter = null;
             }
         }
     } finally {
         base.Dispose(disposing);
     }
 }
Exemplo n.º 10
0
        private void listViewNodes_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            ListViewItemSorter sorter = (ListViewItemSorter)listViewNodes.ListViewItemSorter;

            if (sorter.Column == e.Column)
            {
                sorter.Reverse = !sorter.Reverse;
            }
            else
            {
                sorter.Reverse = false;
                sorter.Column  = e.Column;
            }

            listViewNodes.Sort();
        }
Exemplo n.º 11
0
        public SitesPage(MainForm form)
        {
            InitializeComponent();
            btnGo.Image      = DefaultTaskList.GoImage;
            btnShowAll.Image = DefaultTaskList.ShowAllImage;

            imageList1.Images.Add(Resources.site_16);
            imageList1.Images.Add(Resources.site_stopped_16);
            imageList1.Images.Add("Ascending", Resources.Ascending);
            imageList1.Images.Add("Descending", Resources.Descending);
            imageList1.Images.Add("None", Resources.None);
            foreach (ColumnHeader listView1Column in listView1.Columns)
            {
                listView1Column.ImageKey = "None";
            }
            _form  = form;
            sorter = new ListViewItemSorter();
            listView1.ListViewItemSorter = sorter;
        }
 private void lvThreads_ColumnClick(object sender, ColumnClickEventArgs e)
 {
     ListViewItemSorter sorter = (ListViewItemSorter)lvThreads.ListViewItemSorter;
     if (sorter == null) {
         sorter = new ListViewItemSorter(e.Column);
         lvThreads.ListViewItemSorter = sorter;
     }
     else if (e.Column != sorter.Column) {
         sorter.Column = e.Column;
         sorter.Ascending = true;
     }
     else {
         sorter.Ascending = !sorter.Ascending;
     }
     lvThreads.Sort();
 }
Exemplo n.º 13
0
        public void ConstructorInitializesSortColumnAndSortOrder()
        {
            var listViewItemSorter = new ListViewItemSorter(1, SortOrder.Descending);

            Assert.AreEqual(SortOrder.Descending, listViewItemSorter.SortOrder);
        }
Exemplo n.º 14
0
        public void GetSortOrderReturnsAscending()
        {
            var listViewItemSorter = new ListViewItemSorter();

            Assert.AreEqual(SortOrder.Ascending, listViewItemSorter.SortOrder);
        }