?? positioner.cs
字號:
using System;
namespace Flyweight
{
/// <summary>
/// Summary description for Positioner.
/// </summary>
public class Positioner {
private const int pLeft = 30;
private const int pTop = 30;
private const int HSpace = 70;
private const int VSpace = 80;
private const int rowMax = 2;
private int x, y, cnt;
//-----
public Positioner() {
reset();
}
//-----
public void reset() {
x = pLeft;
y = pTop;
cnt = 0;
}
//-----
public int nextX() {
return x;
}
//-----
public void incr() {
cnt++;
if (cnt > rowMax) { //reset to start new row
cnt = 0;
x = pLeft;
y += VSpace;
}
else {
x += HSpace;
}
}
//-----
public int nextY() {
return y;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -