public void ActivateMainMode() { m_isInFight = false; m_grid = FindObjectOfType <GridMain>(); m_infoUIPrefab = Resources.Load <GameObject>("UIPrefabs/infoEnnemy"); SetMainMouseEvents(); }
protected void btnSearch_Click(object sender, EventArgs e) { DBConnect db = new DBConnect(); string nationalcode = txtNationalCode.Value;//.TrimStart('0'); string firstname = txtFirstName.Value; string lastname = txtLastName.Value; string fathersname = txtFathersName.Value; db.Connect(); DataTable dt = db.Select("SELECT TOP 20 [id],[NationalCode],[FirstName],[LastName],[FathersName] " + "FROM [Personal] WHERE [NationalCode] LIKE '%" + nationalcode + "%' AND " + "[FirstName] LIKE N'%" + firstname + "%' AND [LastName] LIKE N'%" + lastname + "%' AND [FathersName] LIKE N'%" + fathersname + "%' " + "ORDER BY CAST([Created] AS NVARCHAR(10)) DESC"); GridMain.DataSource = dt; GridMain.DataBind(); db.DisConnect(); if (dt.Rows.Count == 0) { divNew.Style.Clear(); Session["nationalcode"] = nationalcode; Session["firstname"] = firstname; Session["lastname"] = lastname; Session["fathersname"] = fathersname; } }
private void OnDel(GameObject go) { int delId = GetItemValueint("id"); GridMain.resourceMgr.config_map.DelItem(delId); GridMain.resourceMgr.config_map.data.Sort(); FileUtil.Instance().WriteFile("config/" + GridMain.resourceMgr.config_map.name, JsonMapper.ToJson(GridMain.resourceMgr.config_map), true); BattleModel.Instance.crtBattle = null; BattleModel.Instance.Delbattle(delId); string filePath = FileUtil.Instance().FullName("dat/map/" + delId); File.Delete(filePath + ".bytes"); gameObject.SetActive(false); GameObject gridPanel = GameObject.FindGameObjectWithTag("GridMain"); GridMain gridMain = gridPanel.GetComponent <GridMain> (); gridMain.togglePart.UpDateList(FightLayerType.map); GameObject EditPart = GameObject.FindGameObjectWithTag("EditPart"); EditPart.GetComponent <EditPart>().ShowList(FightLayerType.none); //AssetDatabase.Refresh(); }
private void Reload() { Context = new PaySysContext(); Context.MainGroups.Load(); DataContext = Context.MainGroups.Local; foreach (var control in GridMain.FindVisualChildren <UcTextPair>()) { control.UpdateTarget(); } Context.ContractFields.Load(); SmpUcContractFieldTitlesMng.ContractFieldsAll = Context.ContractFields.Local.ToList(); }
// Анимация сетки окна private void GridMainAnimation(double point, Grid[] grids) { ThicknessAnimation animation = new ThicknessAnimation // Новая анимация { From = new Thickness(GridMain.Margin.Left, GridMain.Margin.Top, GridMain.Margin.Right, GridMain.Margin.Bottom), // Стартовая позиция To = new Thickness(point, GridMain.Margin.Top, GridMain.Margin.Right, GridMain.Margin.Bottom), // Конечная позиция Duration = TimeSpan.FromSeconds(1), // Время SpeedRatio = 7 // Скорость }; animation.Completed += (s, a) => GridsVisibility(grids); GridMain.BeginAnimation(MarginProperty, animation); // Запуск }
private void Button_Click_5(object sender, RoutedEventArgs e) { DoubleAnimation animation = new DoubleAnimation(); animation.To = gridHeight; animation.From = 0; animation.Duration = new Duration(TimeSpan.FromMilliseconds(100)); GridMain.BeginAnimation(HeightProperty, animation); animation.From = gridHeight; animation.To = 0; animation.Duration = new Duration(TimeSpan.FromMilliseconds(100)); GridMain1.BeginAnimation(HeightProperty, animation); tabSubject.IsEnabled = true; ShowGrade.IsEnabled = true; }
protected void PrevStep() { if (step > 0) { // back to previous step step -= 1; GridMain.Children.Clear(); GridMain.Children.Add(ListUC[step]); GridCursor.Margin = new Thickness(0, 60 * step, 0, 0); } else { // close this window (will return MainWindow) var window = GridMain.GetRootParent() as Window; window.Close(); } }
private void GridMainAnimation(double point, bool completed = false) { ThicknessAnimation animation = new ThicknessAnimation // Новая анимация { From = new Thickness(GridMain.Margin.Left, GridMain.Margin.Top, GridMain.Margin.Right, GridMain.Margin.Bottom), // Стартовая позиция To = new Thickness(point, GridMain.Margin.Top, GridMain.Margin.Right, GridMain.Margin.Bottom), // Конечная позиция Duration = TimeSpan.FromSeconds(1), // Время SpeedRatio = 4, // Скорость }; if (completed) { animation.Completed += Animation_Completed; } GridMain.BeginAnimation(MarginProperty, animation); // Запуск }
/// <summary> /// Binds the grid. /// </summary> /// <param name="text">The text.</param> void BindGrid(string text) { if (String.IsNullOrEmpty(ClassName)) { return; } int total = 0; GridMain.DataSource = genSource(text, out total); GridMain.DataBind(); foreach (GridViewRow gvr in GridMain.Rows) { ImageButton btn = (ImageButton)gvr.FindControl("btnSave"); btn.Attributes.Add("onclick", String.Format("javascript:MC_SELECT_POPUPS['{2}'].selectObject('{0}', '{1}');", _ownerControl, btn.CommandArgument, this.ClientID)); btn.Style.Add("display", "none"); } lblTotalCount.Text = "<b>Total:</b> " + total + " items."; }
public void SetLines(List <Line> newLines) { foreach (Line l in lines) { GridMain.Children.Remove(l); } lines.Clear(); lines.AddRange(newLines); foreach (Line l in lines) { Point p1 = GridMain.PointFromScreen(new Point(l.X1, l.Y1)); Point p2 = GridMain.PointFromScreen(new Point(l.X2, l.Y2)); if (p1.Y < GridViewColumnHeaderTimescale.ActualHeight) { p1.Y = GridViewColumnHeaderTimescale.ActualHeight; } if (p2.Y < GridViewColumnHeaderTimescale.ActualHeight) { p2.Y = GridViewColumnHeaderTimescale.ActualHeight; } l.X1 = p1.X; l.X2 = p2.X; l.Y1 = p1.Y; l.Y2 = p2.Y; l.Stroke = new SolidColorBrush(Color.FromArgb(127, 127, 127, 127)); l.StrokeThickness = 1.0; l.IsHitTestVisible = false; Grid.SetRow(l, 0); Grid.SetRowSpan(l, 2); GridMain.Children.Add(l); } }
private void btnChapter_Click(object sender, RoutedEventArgs e) { DataContext = this; var a = ((Button)sender).Tag; string b = a.ToString(); Subjectcode = (tabSubject.SelectedIndex + 1).ToString(); if (gradecode == null) { gradecode = "1"; } var c = Grade.GetGrade().Where(x => x.Id.Equals(gradecode)).SelectMany(x => x.subjects).Where(x => x.Id.Equals(Subjectcode)).SelectMany(x => x.units).SelectMany(x => x.ListItems).Where(x => x.Id == b).ToList(); ani.Clear(); foreach (var item in c) { ani.Add(item); } //foreach (var item in c) //{ // Items.Add(new Units(item.Title) { Title = item.Title, ListItems = item.ListItems }); //} DoubleAnimation animation = new DoubleAnimation(); animation.From = gridHeight; animation.To = 0; animation.Duration = new Duration(TimeSpan.FromMilliseconds(100)); GridMain.BeginAnimation(HeightProperty, animation); animation.To = gridHeight; animation.From = 0; animation.Duration = new Duration(TimeSpan.FromMilliseconds(100)); GridMain1.BeginAnimation(HeightProperty, animation); tabSubject.IsEnabled = false; ShowGrade.IsEnabled = false; //if (expand == false) //{ // anim1 = new DoubleAnimation(100, TimeSpan.FromSeconds(0.2)); // anim2 = new DoubleAnimation(340, TimeSpan.FromSeconds(0.2)); // anim3 = new DoubleAnimation(0, 90, TimeSpan.FromSeconds(0.2)); // expand = true; //} //else //{ // anim1 = new DoubleAnimation(0, TimeSpan.FromSeconds(0.2)); // anim2 = new DoubleAnimation(240, TimeSpan.FromSeconds(0.2)); // anim3 = new DoubleAnimation(90, 0, TimeSpan.FromSeconds(0.2)); // expand = false; //} //this.BeginAnimation(Canvas.HeightProperty, anim2); //GridMain.BeginAnimation(Canvas.HeightProperty, anim1); // GridMain.Height = 0; //Storyboard storyboard = new Storyboard(); //ObjectAnimationUsingKeyFrames oAnimation = new ObjectAnimationUsingKeyFrames(); //oAnimation.BeginTime = TimeSpan.Zero; //Storyboard.SetTargetName(oAnimation, "GridMain"); //Storyboard.SetTargetProperty(oAnimation, new PropertyPath("(Height)")); //DiscreteObjectKeyFrame doKeyFrame = new DiscreteObjectKeyFrame(); //doKeyFrame.KeyTime = KeyTime.FromTimeSpan(TimeSpan.Zero); //doKeyFrame.Value = GridLength.Auto; //oAnimation.KeyFrames.Add(doKeyFrame); //storyboard.Children.Add(oAnimation); }
private void Save_Executed(object sender, ExecutedRoutedEventArgs e) { // foreach( var control in GridMain.FindVisualChildren<Control>() ) // control.GetBindingExpression( UcTextPair.TextOfLabelProperty )?.UpdateSource(); foreach (var control in GridMain.FindVisualChildren <UcTextPair>()) { control.UpdateSource(); } SmpUcSubGroupEdit.UpdateSource(); #region Contract Fields var expChangedContractFields = Context.ContractFields.Local .Where(c => c.CurrentExpenseArticle?.Code != c.TempCurrentExpenseArticleCode).ToList(); foreach (var cnt in expChangedContractFields) { var exp = Context.ExpenseArticles.FirstOrDefault(x => x.Code == cnt.TempCurrentExpenseArticleCode) ?? Context.ExpenseArticles.Add(new ExpenseArticle { Code = cnt.TempCurrentExpenseArticleCode, IsActive = true }); cnt.CurrentExpenseArticle = exp; // cnt.TempCurrentExpenseArticleCode = exp.Code; } #endregion #region Miscs var expChangedMiscs = Context.Miscs.Local.Where(c => c.ExpenseArticle?.Code != c.TempExpenseArticleCode) .ToList(); foreach (var msc in expChangedMiscs) { var exp = Context.ExpenseArticles.FirstOrDefault(x => x.Code == msc.TempExpenseArticleCode); if (exp == null) { msc.ExpenseArticle = Context.ExpenseArticles.Add(new ExpenseArticle { Code = msc.TempExpenseArticleCode, IsActive = true }); } else { msc.ExpenseArticle = exp; } } #endregion var currentSubGroup = DataGridSubGroups.SelectedItem as SubGroup; #region TaxTable SmpUcTaxTableMng.UpdateSource(); currentSubGroup?.CurrenTaxTable.CommitTempToValues(); #endregion #region HandselFormula Context.HandselFormulas.AddOrUpdate(currentSubGroup?.CurrentOrNewHandselFormula); #endregion #region MissionFormula // Investigating user's checked or not checked ContractFields one by one: foreach (var cf in currentSubGroup.CurrentOrNewMissionFormula.TempMissionFormulaInvolvedContractFieldsLeftJoined) { //User has checked this ContractField but it doesn't exist in involved contract fields list: if (cf.Value && !currentSubGroup.CurrentOrNewMissionFormula.MissionFormulaInvolvedContractFields.Select(f => f.ContractField).Contains(cf.Key)) { currentSubGroup.CurrentOrNewMissionFormula.MissionFormulaInvolvedContractFields.Add(new MissionFormulaInvolvedContractField { ContractField = cf.Key, // MissionFormula = currentSubGroup.CurrentOrNewMissionFormula, }); } //User has unchecked this ContractField but it exists in involved contract fields list: if (!cf.Value && currentSubGroup.CurrentOrNewMissionFormula.MissionFormulaInvolvedContractFields.Select(f => f.ContractField).Contains(cf.Key)) { currentSubGroup.CurrentOrNewMissionFormula.MissionFormulaInvolvedContractFields.Remove(currentSubGroup.CurrentOrNewMissionFormula.MissionFormulaInvolvedContractFields.First(f => f.ContractField == cf.Key)); } } Context.MissionFormulas.AddOrUpdate(currentSubGroup.CurrentOrNewMissionFormula); #endregion Context.SaveChanges(); SmpUcFormStateLabel.CurrentState = FormCurrentState.Select; SmpUcParameterMng.Refresh(); SmpUcContractFieldTitlesMng.Refresh(); SmpUcMiscMng.Refresh(); CollectionViewSource.GetDefaultView(DataGridSubGroups.ItemsSource)?.Refresh(); }
public void Awake() { m_networkIdentity = GetComponent <NetworkIdentity>(); m_HUDUIManager = HUDUIManager.Instance; m_grid = FindObjectOfType <GridMain>(); }
public override void Awake() { base.Awake(); Instance = this; }
private void Window_MouseDown(object sender, MouseButtonEventArgs e) { GridMain.Focus(); }