本文整理汇总了C#中IView.SetController方法的典型用法代码示例。如果您正苦于以下问题:C# IView.SetController方法的具体用法?C# IView.SetController怎么用?C# IView.SetController使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IView
的用法示例。
在下文中一共展示了IView.SetController方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridController
public GridController(IView<string> view, GridFieldModel model)
{
_view = view;
_model = model;
_zoomCheckbox = false;
_view.SetController(this);
_panel = (Panel) _view.Get("Panel");
_trackBar = (TrackBar) _view.Get("Trackbar");
_trackBar.Enabled = false;
_comboBox = (ComboBox) _view.Get("ComboBox");
float tWidth = _panel.Width/_model.Rows.GetLength(1);
float tHeight = _panel.Height/_model.Rows.GetLength(0);
// Doing these checks to make sure that we don't have pixels left
_tileWidth = (_panel.Width%_model.Rows.GetLength(1) != 0 // if width%length != 0
? (int) tWidth++ // then set to width++
: (int) tWidth) // else set to width
*_model.Rows[0, 0].Width; // finally multiply by the tile width
_tileHeight = (_panel.Width%_model.Rows.GetLength(0) != 0
? (int) tHeight++
: (int) tHeight)
*_model.Rows[0, 0].Height;
// only need to draw the grid once, so we can set it as the panel's background
_panel.BackgroundImage = PaintBackground();
_rectangle = new Rectangle(0, 0, 50, 50);
_buffer = new Bitmap(_panel.Width, _panel.Height);
PopulateCombobox();
Resize(this, null);
}
示例2: IController
public IController(IView view)
{
this.view = view;
view.SetController(this);
comModel.comCloseEvent += new SerialPortEventHandler(view.CloseComEvent);
comModel.comOpenEvent += new SerialPortEventHandler(view.OpenComEvent);
comModel.comReceiveDataEvent += new SerialPortEventHandler(view.ComReceiveDataEvent);
}
示例3: Controller
public Controller(IView view, IModel model)
{
this.view = view;
this.model = model;
view.SetController(this);
model.Attach((IModelObserver) view);
view.Changed += new ViewHandler<IView>(this.ViewChanged);
}
示例4: Controller
public Controller(IModel model, IView view, IEmailObjectFactory factory)
{
_model = model;
_view = view;
_view.Closed += new EventHandler(view_Closed);
_view.SetController(this);
_view.SetModel(_model);
_helperFactory = factory;
_view.ShowView();
}
示例5: ComController
public ComController(IView view, Datamanipulation model)
{
this._myView = view;
this._myModel = model;
_myView.SetController(this);
// Need to cast IView v TO MainForm. What for orders form ? =======
this._myModel.Subscribe((MainForm)view);
// Notify if the view is changed:
this._myView.viewChanged += new ViewHandler<IView>(this.ViewChangeDetected);
// ???
// view.changed += new ViewHandler<IView>(this.CustomerAdded);
}
示例6: AppController
public AppController(IView view)
{
_view = view;
view.SetController(this);
}