コード例 #1
0
ファイル: BaseView.cs プロジェクト: DannyGB/wxWidgetsPad
 public abstract void WireUpEvents(object model, ObserverEventArgs e);
コード例 #2
0
ファイル: Form1.cs プロジェクト: DannyGB/wxWidgetsPad
        /// <summary>
        /// Handle the Notify event of the <see cref="IObserver"/> interface for the Model
        /// </summary>
        /// <param name="model">The <see cref="Models.Form1"/></param>
        /// <param name="e">The <see cref="System.EventArgs"/></param>
        public override void ReRender(object model, ObserverEventArgs e)
        {
            Models.Form1 __model = (Models.Form1)model;

            foreach (int changedControl in e.ChangedControls)
            {
                switch (changedControl)
                {
                    case (int)ID_CONTROLS.ID_TEXT:
                        this.text.Clear();
                        this.text.AppendText(__model.File.ReadToEnd());
                        break;
                    case (int)ID_CONTROLS.ID_FORM_TITLE:
                        this.Title = __model.Title;
                        break;
                    case (int)ID_CONTROLS.ID_MENU_BAR:
                        this.MenuBar = new MenuBar();
                        foreach (QueueStruct list in __model.Menus)
                        {
                            MenuBar.Append(this.CreateMenu(list.Menus), list.Title);
                        }
                        break;
                    default:
                        break;
                }
            }
        }
コード例 #3
0
ファイル: BaseView.cs プロジェクト: DannyGB/wxWidgetsPad
 public abstract void ReRender(object model, ObserverEventArgs e);
コード例 #4
0
ファイル: Form1.cs プロジェクト: DannyGB/wxWidgetsPad
        /// <summary>
        /// Handle the Notify event of the <see cref="IObserver"/> interface for the Controller
        /// </summary>
        /// <param name="controller">The <see cref="Controllers.Form1"/></param>
        /// <param name="e">The <see cref="System.EventAgs"/></param>
        public override void WireUpEvents(object controller, ObserverEventArgs e)
        {
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_ABOUT, new EventListener(((Controllers.Form1)controller).OnAboutMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_EXIT, new EventListener(((Controllers.Form1)controller).OnExitMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_OPEN, new EventListener(((Controllers.Form1)controller).OnOpenMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_GERMAN_LANGUAGE, new EventListener(((Controllers.Form1)controller).OnLanguageChangeClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_ENGLISH_LANGUAGE, new EventListener(((Controllers.Form1)controller).OnLanguageChangeClick));

            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_COPY, new EventListener(((Controllers.Form1)controller).OnCopyMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_CUT, new EventListener(((Controllers.Form1)controller).OnCutMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_DELETE, new EventListener(((Controllers.Form1)controller).OnDeleteMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_PASTE, new EventListener(((Controllers.Form1)controller).OnPasteMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_SAVE, new EventListener(((Controllers.Form1)controller).OnSaveMenuClick));
            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_SAVE_AS, new EventListener(((Controllers.Form1)controller).OnSaveAsMenuClick));

            EVT_MENU((int)Views.Form1.ID_CONTROLS.ID_MENU_CLOSE, new EventListener(((Controllers.Form1)controller).OnCloseMenuClick));

            EVT_SIZE(new EventListener(this.OnSize));
        }