예제 #1
0
        public override void Startup()
        {
            FormViewModule viewMod = EditorService.Instance.QueryModule<FormViewModule>(null);

            // NOTE [操作模式参考] 如果操作模式需要用到视图,可以用QueryView从调度层请求过来
            customView = viewMod.QueryView<ICustomView>(null);
            canvas = (ICanvasView)viewMod.QueryView<ICustomView>(null);
            stageEditCtrl = (StageEditControl)canvas;

            // NOTE [操作模式参考] 以下代码也是控制ICustomView呈现的例子
            // customView.AddPickOneChooser2("rb3", new String[] { "图章", "自由" }, makeMode);
            // customView.AddCommander("在视图中心创建", delegate { createSpriteInMiddleOfView(); });
            // customView.AddYesNoChooser("cb1", "半透明", isHalfAlpha);
            // customView.AddPickOneChooser("cbb2", new String[] { "默认名称", "名称1", "名称2", "名称3" }, 0);
        }
 public Test3Presenter(ICustomView view)
     : base(view)
 {
 }
예제 #3
0
 /// <summary>
 /// Gets all the custom properties assigned to the class
 /// </summary>
 /// <param name="view">
 /// The view.
 /// </param>
 /// <returns>
 /// The <see cref="List{T}"/>.
 /// </returns>
 public static List <CustomPropertyAttribute> GetCustomProperties(this ICustomView view)
 {
     return(view.GetType().GetCustomAttributes <CustomPropertyAttribute>().OrderBy(x => x.Order).ToList());
 }
 public Test8Presenter(ICustomView view)
     : base(view)
 {
     // Do it via the property
     View.Model = new CustomViewModel();
 }