📄 scroll_maker.cs
字号:
namespace Imps.Client.Pc.BizControls
{
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public sealed class scroll_maker
{
public static readonly scroll_maker instance = new scroll_maker();
private Dictionary<scroll_widget, bool> m_scroll_map = new Dictionary<scroll_widget, bool>();
private scroll_maker()
{
}
public void browse_scrolls(browse_scroll_handler handler)
{
if (handler == null)
{
throw new ArgumentNullException();
}
Dictionary<scroll_widget, bool>.Enumerator enumerator = this.m_scroll_map.GetEnumerator();
while (enumerator.MoveNext())
{
browse_event_args args = new browse_event_args();
args.scroll = enumerator.get_Current().get_Key();
handler(this, args);
if (args.cancel)
{
return;
}
}
}
public hscroll_widget hscroll()
{
hscroll_widget _widget = new hscroll_widget();
this.m_scroll_map.set_Item(_widget, true);
_widget.HandleDestroyed += new EventHandler(this.on_scroll_destroyed);
return _widget;
}
public t_hscroll hscroll<t_hscroll>(t_hscroll hs)
{
if (hs == null)
{
throw new ArgumentNullException();
}
if (!(hs is scroll_widget))
{
throw new InvalidCastException();
}
if (((scroll_widget) hs).vertical)
{
throw new InvalidCastException();
}
this.m_scroll_map.set_Item((scroll_widget) hs, true);
return hs;
}
private void on_scroll_destroyed(object sender, EventArgs args)
{
if (!(sender is scroll_widget))
{
throw new InvalidCastException();
}
this.m_scroll_map.Remove((scroll_widget) sender);
}
public vscroll_widget vscroll()
{
vscroll_widget _widget = new vscroll_widget();
this.m_scroll_map.set_Item(_widget, true);
_widget.HandleDestroyed += new EventHandler(this.on_scroll_destroyed);
return _widget;
}
public t_vscroll vscroll<t_vscroll>(t_vscroll vs)
{
if (vs == null)
{
throw new ArgumentNullException();
}
if (!(vs is scroll_widget))
{
throw new InvalidCastException();
}
if (!((scroll_widget) vs).vertical)
{
throw new InvalidCastException();
}
this.m_scroll_map.set_Item((scroll_widget) vs, true);
return vs;
}
public class browse_event_args : EventArgs
{
public bool cancel;
public object context;
public scroll_widget scroll;
}
public delegate void browse_scroll_handler(scroll_maker reserved, scroll_maker.browse_event_args args);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -