本文整理匯總了C#中System.IntPtr.Decrement方法的典型用法代碼示例。如果您正苦於以下問題:C# IntPtr.Decrement方法的具體用法?C# IntPtr.Decrement怎麽用?C# IntPtr.Decrement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IntPtr
的用法示例。
在下文中一共展示了IntPtr.Decrement方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: readWriteAddressMemoryMenuItem_Click
private void readWriteAddressMemoryMenuItem_Click(object sender, EventArgs e)
{
PromptBox prompt = new PromptBox();
if (prompt.ShowDialog() == DialogResult.OK)
{
IntPtr address = new IntPtr(-1);
IntPtr regionAddress = IntPtr.Zero;
long regionSize = 0;
bool found = false;
try
{
address = ((long)BaseConverter.ToNumberParse(prompt.Value)).ToIntPtr();
}
catch
{
PhUtils.ShowError("You have entered an invalid address.");
return;
}
List<MemoryItem> items = new List<MemoryItem>();
foreach (MemoryItem item in _provider.Dictionary.Values)
items.Add(item);
items.Sort((i1, i2) => i1.Address.CompareTo(i2.Address));
int i = 0;
foreach (MemoryItem item in items)
{
if (item.Address.CompareTo(address) > 0)
{
MemoryItem regionItem = items[i - 1];
listMemory.Items[regionItem.Address.ToString()].Selected = true;
listMemory.Items[regionItem.Address.ToString()].EnsureVisible();
regionAddress = regionItem.Address;
regionSize = regionItem.Size;
found = true;
break;
}
i++;
}
if (!found)
{
PhUtils.ShowError("Unable to find the memory address.");
return;
}
MemoryEditor m_e = MemoryEditor.ReadWriteMemory(_pid, regionAddress, (int)regionSize, false,
new Program.MemoryEditorInvokeAction(delegate(MemoryEditor f) { f.Select(address.Decrement(regionAddress).ToInt64(), 1); }));
}
}
示例2: GetCellId
private MfsCellId GetCellId(IntPtr cellView)
{
IntPtr view;
view = this.GetBlock(cellView);
return new MfsCellId(
_views2[view].BlockId,
(ushort)(cellView.Decrement(view).ToInt32() / _cellSize)
);
}