void UpdateBlur() { if (null == _blur) { return; } if (_needBlurViewSet.Count > 0) { _blur.gameObject.SetActive(true); for (int i = viewList.Count - 1; i > -1; i--) { AView view = viewList[i]; if (_needBlurViewSet.Contains(view)) { int viewChildIdx = view.gameObject.transform.GetSiblingIndex(); int blurChildIdx = _blur.transform.GetSiblingIndex(); if (blurChildIdx < viewChildIdx) { viewChildIdx--; } _blur.transform.SetSiblingIndex(viewChildIdx); return; } } } else { _blur.gameObject.SetActive(false); } _blur.transform.SetSiblingIndex(_blur.transform.parent.childCount - 2); }
private void AssignmentsForm_Load(object sender, EventArgs e) { DisplayData = OrganizerLibrary.GlobalConfig.Connections[0].GetAssignment_All(); DisplayData.Add(new AssignmentModel()); AView.DataSource = DisplayData; AView.ClearSelection(); }
private int ComparerView(AView x, AView y) { int xIdx = x.gameObject.transform.GetSiblingIndex(); int yIdx = y.gameObject.transform.GetSiblingIndex(); return(xIdx - yIdx); }
void ShowViewAndWaitForClosing(Action _onViewClosed) { AView view = new AView(); view.Show(); view.Closed += (o, e) => { _onViewClosed(); }; }
public AView GetView() { if (m_View == null) { m_View = CreateView(); } return(m_View); }
/// <summary> /// View对象销毁的回调 /// </summary> /// <param name="view"></param> void OnViewDestroy(AView view) { if (Current == view) { Current.onDestroyed -= OnViewDestroy; Current = null; } }
public void CreateBlock() { //以同步方式创建Block AView.Create <Block>(_blockPrefab, this, _blocks); //以异步方式创建Block //AView.CreateAsync<Block>("Block", "hot_res/prefabs/stages/gamestage.ab", this, _blocks, null, OnCreated); }
public AView GetView() { if (View == null) { View = CreateView(); } return(View); }
/* the code to tell the checkbox it is done editing when it is clicked, * instead of waiting till the user leaves the field*/ private void AView_OnCellMouseUp(object sender, DataGridViewCellMouseEventArgs e) { // End of edition on each click on column of checkbox if (e.ColumnIndex == 3 && e.RowIndex != -1) { AView.EndEdit(); } }
public override void Clear() { if (null != Current) { Current.onDestroyed -= OnViewDestroy; Current.Destroy(); Current = null; } }
private void OnASyncShow(AView view, object token) { var onCreated = token as Action <AView>; if (null != onCreated) { onCreated.Invoke(view); } }
public ControlerSender(Telegram.Bot.TelegramBotClient bot) { modelPerson = new ModelPerson(); modelGuild = new ModelGuild(); modelTavern = new ModelTavern(); view = new AView(); viewTown = new ViewTown(); viewGuild = new ViewGuild(); this.bot = bot; }
void OnShowView(AView view, bool isBlur, bool isCloseOthers) { view.onDestroyed += OnViewDestroy; if (isBlur) { _needBlurViewSet.Add(view); UpdateBlur(); } }
public MainWindow() { InitializeComponent(); var view = new AView(); var viewModel = new AViewModel(); view.DataContext = viewModel; ViewPlaceholder.Children.Clear(); ViewPlaceholder.Children.Add(view); }
private void OnAsyncOpen(AView view, object token) { var setting = (WinSetting)token; OnShowView(view, setting.isBlur, setting.isCloseOthers); if (null != setting.onCreated) { setting.onCreated.Invoke(view); } }
void OnShowView(AView view, bool isBlur, bool isCloseOthers) { _layer.ViewList.Sort(ComparerView); view.onDestroyed += OnViewDestroy; if (isBlur) { _needBlurViewSet.Add(view); UpdateBlur(); } }
/// <summary> /// 切换视图 /// </summary> /// <param name="view"></param> protected override void ShowView(AView view) { if (null != Current) { Current.onDestroyed -= OnViewDestroy; Current.Destroy(); Current = null; } Current = view; view.onDestroyed += OnViewDestroy; }
IEnumerator Switch(AView oldView, AView newView, Action <ASingularViewSwitchAnimator> onSwitchComplete) { var oldCG = oldView.GetComponent <CanvasGroup>(); var newCG = newView.GetComponent <CanvasGroup>(); newCG.alpha = 0; while (newCG.alpha < 1) { newCG.alpha += 0.01f; oldCG.alpha -= 0.01f; yield return(new WaitForEndOfFrame()); } onSwitchComplete.Invoke(this); }
public void WhenOnAutoWireViewModelChangedThenViewBindingContextIsViewModel() { InitializeAViewModelIoC(); var view = new AView(); var autoWireViewModel = ViewModelLocator.GetAutoWireViewModel(view); Check.That(autoWireViewModel).IsFalse(); ViewModelLocator.SetAutoWireViewModel(view, true); Check.That(view.BindingContext).IsInstanceOf <AViewModel>(); autoWireViewModel = ViewModelLocator.GetAutoWireViewModel(view); Check.That(autoWireViewModel).IsTrue(); }
/// <summary> /// Constructor /// </summary> /// <param name="gf">The main game's form</param> /// <param name="sw">The timer stopwatch</param> internal Game(GameForm gf, Stopwatch sw) { // start music // this.sp = new SoundPlayer(Properties.Resources.bg_music); // this.sp.PlayLooping(); this.sfxOn = true; // member init this.sfx = new SoundPlayer(); this.stopWatch = sw; this.player = new Player("TheH3ro"); this.monster = new List <Monster>(); InitLevel(this.levelSize); // initialize game view this.view = GraphicalView.Create(gf); }
public void WhenOnAutoWireViewModelChangedAndViewModelNotRegisterThenNothing() { var view = new AView(); Check.ThatCode(() => ViewModelLocator.SetAutoWireViewModel(view, true)).Throws <KeyNotFoundException>(); }
public AView GetView() { if (View == null) View = CreateView(); return View; }
public AViewTests() { view = Substitute.For <AView>(); }
public override void StartSwitch(AView oldView, AView newView, Action <ASingularViewSwitchAnimator> onSwitchComplete) { ILBridge.Ins.StartCoroutine(Switch(oldView, newView, onSwitchComplete)); }
private void OnCreated(AView view) { Debug.Log("创建完成:" + view.gameObject.name); }
/// <summary> /// View对象销毁的回调 /// </summary> /// <param name="view"></param> void OnViewDestroy(AView view) { view.onDestroyed -= OnViewDestroy; _needBlurViewSet.Remove(view); UpdateBlur(); }
public AView GetView() { if (m_View == null) m_View = CreateView(); return m_View; }