// This function will draw UI components void OnGUI() { // Getting current view by active view name: ViewInterface currentView = (ViewInterface)viewByName[activeViewName]; // Set blockUI for current view: currentView.setBlockUI(blockUI); // Rendering current view: currentView.render(); // Show box with "Wait..." when UI is blocked: var screenWidth = Screen.width; var screenHeight = Screen.height; if (blockUI) { GUI.Box(new Rect((screenWidth - 200) / 2, (screenHeight - 60) / 2, 200, 60), "Wait..."); } if (asyncOp != null && !asyncOp.isDone) { GUIStyle style = new GUIStyle(GUI.skin.box); style.normal.background = MakeTex(2, 2, new Color(0f, 1f, 0f, 0.5f)); GUI.Box(new Rect(0, Screen.height - 40, asyncOp.progress * Screen.width, 40), "", style); } }
private void Instantiate() { int[] InitialBoard = BackgammonGame.DefaultGameBoard; // Board.TestBoard3; Board = new Board(InitialBoard); Model = new BackgammonGame(InitialBoard, new RealDice()); ViewInterface = new ViewInterface(Model); Model.ConnectView(this); if (WhitePlayer == PlayerType.Online) { TCPManager.Instance.Instantiate(Model, White); } if (BlackPlayer == PlayerType.Online) { TCPManager.Instance.Instantiate(Model, Black); } if (OptionScreen.ShowPips.SwitchedOn) { WhitePips = new Image() { Text = "White: " + Model.GetGameBoardState().pip(White), Position = new Vector2(Board.midX, 700) }; BlackPips = new Image() { Text = "Black: " + Model.GetGameBoardState().pip(Black), Position = new Vector2(Board.midX, 20) }; WhitePips.LoadContent(); BlackPips.LoadContent(); } }
/// <summary> /// Add View /// </summary> /// <param name="key_view"></param> /// <param name="view"></param> public void addAVCLANListener(String key_view, ViewInterface listener) { if ((key_view != null) && (listener != null)) { AVCLAN_Listeners.Add(key_view, listener); listener.setCommunicationDelegate(new SendAVCLANMessage(sendBlueBoxMessage)); } }
public void AddItemToViewStruct() { ViewInterface.Remove_Button_Enabler(true); ModelInterface.AddItemToViewStruct(new ModelMVPDataBasePart.Common.EventDataCreator(ViewInterface.Namebox, ViewInterface.EventHappen, (int)ViewInterface.WhichTypeOfRemind, ViewInterface.EventDuration)); ViewInterface.AdditemToView(new System.Windows.Forms.ListViewItem(new string[] { ViewInterface.EventHappen.ToString(ViewInterface.MaskFormat), RadioCheckedInToTextValue((int)ViewInterface.WhichTypeOfRemind), EventDurationToStringConverter(ViewInterface.EventDuration) })); }
public void SetUp(ViewInterface view, FileModelInterface fileModel) { this.view = view; this.fileModel = fileModel; this.quiz = this.GetEmptyQuiz(); this.LoadQuiz(quiz); }
public override void Run(ArgDepositer <int, string> Arg) { switch (Arg.FirstDataHandler) { case 0: ViewInterface.FirstPanelInitialization(Arg.FirstDataHandler, ModelInterface.GetEventNames(Controller.DBClass)); ViewInterface.Show(); break; } }
public AppController(Model.AppContext model, ViewInterface view) { this.view = view; this.model = model; manageUser = new ManageUsers(model, view); manageCars = new ManageCars(model, view); manageReservation = new ManageReservation(model, view); view.SetController(this); view.GetCarData(); startApp(); }
public override void Draw(ViewInterface view) { GraphicsPath path = new GraphicsPath(); path.StartFigure(); // Start the first figure. path.AddEllipse((float)(Point.X) - 1, (float)view.Height - (float)Point.Y - 1, 2, 2); path.CloseFigure(); // Second figure is closed. view.SetPenColor(this.BrushColor); view.Path(path); }
private void Login(string Username, string Pass) { if (ModelInterface.Login(Username, Pass, Controller.DBClass)) { Controller.Run <MainInterfacePresenter>(); ViewInterface.Close(); } else { ; //Сообщение об ошибке } }
public override void Draw(ViewInterface view) { view.SetPenColor(this.PenColor); GraphicsPath path = new GraphicsPath(); path.StartFigure(); // Start the first figure. path.AddLine((float)(Edge.Org.X), (float)view.Height - (float)Edge.Org.Y, (float)Edge.Dest.X, (float)view.Height - (float)Edge.Dest.Y); path.CloseFigure(); // Second figure is closed. view.Path(path); }
public override void Draw(ViewInterface view) { var points = new PointF[this.Polygon.Size()]; for (int i = 0; i < this.Polygon.Size(); i++, this.Polygon.Advance(Rotation.CLOCKWISE)) { points[i] = new PointF((float)this.Polygon.Point().X, (float)view.Height - (float)this.Polygon.Point().Y); } GraphicsPath path = new GraphicsPath(); path.StartFigure(); // Start the first figure. path.AddLines(points); path.CloseFigure(); // Second figure is closed. view.SetPenColor(this.PenColor); view.Path(path); }
public ManageReservation(Model.AppContext model, ViewInterface view) { this.model = model; this.view = view; }
public abstract void Draw(ViewInterface view);
public ManageCars(Model.AppContext model, ViewInterface view) { this.model = model; this.view = view; }
public void RemoveSelectRemind(int arg) { ModelInterface.RemoveItemFromListStruct(arg); ViewInterface.RemoveSelectedItem_From_RemindersList(arg); }
public void Run() { ViewInterface.Show(); }
public PointRelationPosController(ViewInterface view) : base(view) { }
public void RemoveRangeItemsFromViewStruct(IEnumerable <int> ItemIndecies) { ModelInterface.RemoveRangeItemsFromViewStruct(ItemIndecies); ViewInterface.RemoveSelectedItemsFromView(); }
public Controller(ViewInterface view) { this.View = view; }
protected SceneDrawController(ViewInterface view) : base(view) { this.scene = new List <ViewItemInterface>(); }
public IntersectDrawController(ViewInterface view) : base(view) { }