Я посмотрел бы на исходный код для jQuery. В строке последней версии 3287.
я мог бы добавить в функциях "serialize2" и "serializeArray2". конечно, назовите их чем-то meaniful.
Или лучший путь должен был бы записать что-то для вытаскивания неиспользованного Вара из serializedFormStr. Некоторый regex, который ищет = & в середине строки или заканчивающийся в = Какие-либо regex мастера вокруг?
ОБНОВЛЕНИЕ: мне нравится ответ rogeriopvl лучше (+1)... тем более, что я не могу найти хорошие regex инструменты прямо сейчас.
Нет управляемого способа сделать схему. Однако в GDI + есть функция GdipWindingModeOutline, которая может делать именно это. Вот ссылка на MSDN Этот код решает проблему:
// Declaration required for interop
[DllImport(@"gdiplus.dll")]
public static extern int GdipWindingModeOutline( HandleRef path, IntPtr matrix, float flatness );
void someControl_Paint(object sender, PaintEventArgs e)
{
// Create a path and add some rectangles to it
GraphicsPath path = new GraphicsPath();
path.AddRectangles(rectangles.ToArray());
// Create a handle that the unmanaged code requires. nativePath private unfortunately
HandleRef handle = new HandleRef(path, (IntPtr)path.GetType().GetField("nativePath", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(path));
// Change path so it only contains the outline
GdipWindingModeOutline(handle, IntPtr.Zero, 0.25F);
using (Pen outlinePen = new Pen(Color.FromArgb(255, Color.Red), 2))
{
g.DrawPath(outlinePen, path);
}
}
I cannot try it myself, but I think you should create a Region object with your shapes' intersections and then use the FrameRgn API.
Here is its pinvoke signature:
[DllImport("gdi32.dll")]
static extern bool FrameRgn(
IntPtr hdc,
IntPtr hrgn,
IntPtr hbr,
int nWidth,
int nHeight);
P.S: please post your solution if this works, I'm curious :)