优化部分代码

This commit is contained in:
蓝点lilac
2021-05-15 05:22:12 +08:00
parent 312bddb7f6
commit 6c0b32b490
4 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
using System.Text;
using System.Net;
using System.Net;
using System.Text;
namespace BluePointLilac.Methods
{

View File

@@ -34,7 +34,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>

View File

@@ -23,8 +23,9 @@ namespace ContextMenuManager.Controls.Interfaces
{
MyList list = (MyList)listItem.Parent;
int index = list.GetItemIndex(listItem);
index -= (index < list.Controls.Count) ? 0 : 1;
item.DeleteMe();
list.HoveredItem = (MyListItem)list.Controls[index - 1];
list.HoveredItem = (MyListItem)list.Controls[index];
}
};
}

View File

@@ -40,8 +40,9 @@ namespace ContextMenuManager.Controls.Interfaces
MyListItem listItem = (MyListItem)item;
MyList list = (MyList)listItem.Parent;
int index = list.GetItemIndex(listItem);
index -= (index < list.Controls.Count) ? 0 : 1;
item.DeleteMe();
list.HoveredItem = (MyListItem)list.Controls[index - 1];
list.HoveredItem = (MyListItem)list.Controls[index];
};
}
}