public override void OnClick() { if (m_Hook != null) { LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); if (log != null) { log.Writelog("保存地图文档"); } } string strWorkFile = Application.StartupPath + "\\..\\Temp\\CurPrj.xml"; System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument(); xmldoc.Load(strWorkFile); SetControl pSetControl = (SetControl)m_Hook.MainUserControl; string savefilename = pSetControl.m_SaveXmlFileName; xmldoc.Save(savefilename); /* Exception eError; * AddGroup frmGroup = new AddGroup(); * if (frmGroup.ShowDialog() == DialogResult.OK) * { * ModuleOperator.DisplayRoleTree("", m_Hook.RoleTree, ref ModData.gisDb, out eError); * if (eError != null) * { * ErrorHandle.ShowFrmError("提示", eError.Message); * return; * } * } */ }
public override void OnClick() { if (m_Hook == null) { return; } if (m_Hook.ArcGisMapControl == null) { return; } if (m_Hook.ArcGisMapControl.Map == null) { return; } IMap pMap = m_Hook.ArcGisMapControl.Map; if (pMap.LayerCount == 0) { return; } FormStatic form = new FormStatic(); form.InitForm(pMap); form.ShowDialog(); SetControl pSetControl = m_Hook.MainUserControl as SetControl; //pSetControl.InitOutPutResultTree(); }
public override void OnClick() { if (m_Hook == null) { return; } SysCommon.CProgress vProgress = new SysCommon.CProgress("½ø¶ÈÌõ"); vProgress.EnableCancel = false; vProgress.ShowDescription = true; vProgress.FakeProgress = true; vProgress.TopMost = true; vProgress.ShowProgress(); LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); string strLog = "Ñ¡Ôñͼ°ßÑÐÅÐ"; vProgress.SetProgress("Ñ¡Ôñͼ°ßÑÐÅÐ"); if (log != null) { log.Writelog(strLog); } SetControl pSetControl = (SetControl)m_Hook.MainUserControl; pSetControl.SelectJudge(vProgress); vProgress.Close(); }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("矩形范围出图"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } _cmd = new GeoPageLayout.CommandRectangleOutmap(); CommandRectangleOutmap tempCommand = _cmd as CommandRectangleOutmap; tempCommand.WriteLog = this.WriteLog; //ygc 2012-9-12 是否写日志 tempCommand.OnCreate(m_Hook); m_Hook.MapControl.CurrentTool = tempCommand as ITool; SetControl pSetControl = m_Hook.MainUserControl as SetControl; //pSetControl.InitOutPutResultTree(); }
public Form1() { InitializeComponent(); viewChanger = new SetControl(SetControl); gameControl = new ucGame(viewChanger); gameControl.Dock = DockStyle.Fill; startControl = new ucStartPanel(viewChanger); startControl.Dock = DockStyle.Fill; LoadGameFromFile(); SetControl(ViewToSelect.Main, status); this.ResizeEnd += (sender, e) => { gameControl.UcGame_CreateBackBuffer(sender, e); }; }
public override void OnClick() { if (m_Hook == null) { return; } if (m_Hook.ArcGisMapControl == null) { return; } FormLandUseReport form = new FormLandUseReport(); form.ShowDialog(); SetControl pSetControl = m_Hook.MainUserControl as SetControl; //if (pSetControl!=null) pSetControl.InitOutPutResultTree(); }
public override void OnClick() { if (m_Hook == null) { return; } OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "xml文件|*.xml"; dlg.ShowDialog(); string xmlpath = dlg.FileName; if (xmlpath.Equals("")) { return; } SysCommon.CProgress vProgress = new SysCommon.CProgress("进度条"); vProgress.EnableCancel = false; vProgress.ShowDescription = true; vProgress.FakeProgress = true; vProgress.TopMost = true; vProgress.ShowProgress(); LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); string strLog = "加载地图文档,原始文件路径:" + xmlpath; vProgress.SetProgress("开始加载地图文档"); if (log != null) { log.Writelog(strLog); } string strWorkFile = Application.StartupPath + "\\..\\Temp\\CurPrj.xml"; System.IO.File.Copy(xmlpath, strWorkFile, true); SetControl pSetControl = (SetControl )m_Hook.MainUserControl; //清空前次加载的图层 pSetControl.m_SaveXmlFileName = xmlpath; pSetControl.LoadDatafromXml(strWorkFile, vProgress); vProgress.Close(); }
public H_CZ_CARD_SUB(HelpParam helpParam) : base(helpParam) { InitializeComponent(); base.SetIHelp = this as IHelp; InitGrid(); DataSet ds = Global.MainFrame.GetComboData("S;FI_B000016", "S;MA_B000057"); SetControl st = new SetControl(); st.SetCombobox(cbo신용카드구분, ds.Tables[0]); st.SetCombobox(cbo사용여부, ds.Tables[1]); cbo사용여부.SelectedValue = "Y"; SetDefault(base.Get타이틀명, flex, btn확인, btn검색, btn취소, txt검색); helpParam.QueryAction = QueryAction.RealTime; txt검색.Text = helpParam.P92_DETAIL_SEARCH_CODE; }
public override void OnClick() { if (m_Hook == null) { return; } //LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); //if (log != null) //{ // log.Writelog("选择要素范围出图"); //} if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); if (this.WriteLog) { Plugin.LogTable.Writelog("选择要素范围出图 提示'当前没有调阅数据!'", m_Hook.tipRichBox); } return; } if (this.WriteLog) { Plugin.LogTable.Writelog("选择要素范围出图", m_Hook.tipRichBox); } _cmd = new GeoPageLayout.CommandSelOutmap(); CommandSelOutmap TempCommand = _cmd as CommandSelOutmap; TempCommand.WriteLog = this.WriteLog;//ygc 2012-9-12 是否写日志 TempCommand.OnCreate(m_Hook); TempCommand.OnClick(); SetControl pSetControl = m_Hook.MainUserControl as SetControl; if (pSetControl != null) { pSetControl.InitOutPutResultTree(); } }
public override void OnClick() { if (m_Hook == null) { return; } LogFile log = new LogFile(m_Hook.tipRichBox, m_Hook.strLogFilePath); if (log != null) { log.Writelog("生成土地利用现状图"); } if (m_Hook.ArcGisMapControl.Map.LayerCount == 0) { MessageBox.Show("当前没有调阅数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //? GeoPageLayout.GeoPageLayout pPageLayout = new GeoPageLayout.GeoPageLayout(m_Hook.ArcGisMapControl.Map); //? pPageLayout.MapTdlyxz(); // ? pPageLayout = null; SetControl pSetControl = m_Hook.MainUserControl as SetControl; //pSetControl.InitOutPutResultTree(); }
protected override async void RelayMethod(object obj) { string command = obj.ToString(); // Do:应用 if (command == "Button.Click.Edit") { this.ImageCollection.Clear(); EditDialog detial = new EditDialog() { DataContext = this }; MessageService.ShowWithLayer(detial); var model = await await MessageService.ShowWaittingResultMessge(() => { string id = this.SelectedItem?.ID; return(this.Respository.GetMovieWIthDetial(id)); }); this.ImageCollection = model.Item2?.ToObservable(); } // Do:取消 else if (command == "Button.Click.Load") { if (this.SelectCase == null) { MessageService.ShowSnackMessageWithNotice("请先选择案例!"); return; } var from = await MessageService.ShowWaittingResultMessge(() => { return(this.Respository.GetListAsync(l => l.CaseType == this.SelectCase.ID).Result); }); if (from == null) { MessageService.ShowSnackMessageWithNotice("没有视频数据,请先生成视频数据"); return; } #pragma warning disable CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法 Task.Run(() => { this.ObservableSource.Clear(); foreach (var item in from) { MovieModelViewModel viewModel = new MovieModelViewModel(item); this.ObservableSource.Add(viewModel); Thread.Sleep(2); } MessageService.ShowSnackMessageWithNotice("加载完成..."); }); #pragma warning restore CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法 } else if (command == "ListBox.SelectionChanged.Filter") { var tags = this.SelectTag.ToList(); Func <MovieModelViewModel, bool> expression = l => { if (tags == null || tags.Count == 0) { return(true); } if (string.IsNullOrEmpty(l.TagTypes)) { return(false); } return(tags.TrueForAll(k => l.TagTypes.Trim().Split(',').ToList().Exists(m => m == k.Name))); }; this.ObservableSource.Fileter = l => expression(l); } else if (command == "ListBox.SelectionChanged.OrderBy") { if (this.OrderBy == "按名称排序") { this.ObservableSource.Sort(l => l.Name, this.Desc); } else if (this.OrderBy == "按大小") { this.ObservableSource.Sort(l => l.Size, this.Desc); } else if (this.OrderBy == "按评分") { this.ObservableSource.Sort(l => l.Score, this.Desc); } else if (this.OrderBy == "按总时间") { this.ObservableSource.Sort(l => l.Duration, this.Desc); } else if (this.OrderBy == "按播放次数") { this.ObservableSource.Sort(l => l.PlayCount, this.Desc); } else if (this.OrderBy == "按清晰度") { this.ObservableSource.Sort(l => l.ArticulationType, this.Desc); } else if (this.OrderBy == "按缩略图") { this.ObservableSource.Sort(l => l.Image, this.Desc); } } else if (command == "Button.Click.Set") { SetControl detial = new SetControl() { DataContext = this }; MessageService.ShowWithLayer(detial); } else if (command == "ListBox.SelectionChanged.TagEdit") { Application.Current.Dispatcher.Invoke(() => { if (this.SelectedItem == null) { return; } if (this.EditSelectTag == null || this.EditSelectTag.Count == 0) { return; } this.SelectedItem.TagTypes = this.EditSelectTag?.Select(l => l.Name).Aggregate((l, k) => l + "," + k); }); } else if (command == "Button.Click.SetUpdate") { string message; if (!this.ModelState(this.SelectedItem.Model, out message)) { MessageService.ShowSnackMessage(message); return; } await this.Respository.UpdateAsync(this.SelectedItem.Model); MessageService.CloseWithLayer(); MessageService.ShowSnackMessage("保存成功!"); } else if (command == "Button.Click.DeleteDeep") { if (this.SelectedItem == null) { return; } var result = await MessageService.ShowResultMessge("确定要彻底删除文件?"); if (result) { if (File.Exists(this.SelectedItem.Url)) { File.Delete(this.SelectedItem.Url); MessageService.ShowSnackMessage("文件已删除:" + this.SelectedItem?.Url); this.RelayMethod("Button.Click.Remove"); } } } else if (command == "Button.Click.Remove") { if (this.SelectedItem == null) { return; } await this.Respository.DeleteAsync(this.SelectedItem.Model.ID); this.Invoke(() => this.ObservableSource.Remove(this.SelectedItem)); } else if (command == "BulletCheckBox.CheckedChanged.Click") { { if (!this.IsEditting) { this.Service3.ClipBoardChanged = null; return; } this.Service3.ClipBoardChanged = async() => { //Todo :复制的图片 BitmapSource bit = Clipboard.GetImage(); if (bit != null) { mbc_dv_movieimage image = new mbc_dv_movieimage(); image.MovieID = this.SelectedItem.ID; image.Text = DateTime.Now.ToDateTimeString(); image.TimeSpan = DateTime.Now.ToDateTimeString(); image.Image = ImageService.BitmapSourceToString(bit); await this.Respository.AddMovieImage(image); this.ImageCollection.Add(image); } }; } } else if (command == "Button.Click.DeleteImage") { await this.Service4.DeleteAsync(this.SelectImage); this.ImageCollection.Remove(this.SelectImage); MessageService.ShowSnackMessageWithNotice("删除成功!"); } else if (command == "Button.Click.SetImage") { Application.Current.Dispatcher.Invoke(() => { this.SelectedItem.Image = this.SelectImage?.Image; }); await this.Respository.SaveAsync(); } else if (command == "ListBox.SelectionChanged.SelectedtemChanged") { if (this.SelectedItem == null) { return; } var from = this.SelectedItem.TagTypes?.Split(',').ToList(); if (from == null) { this.EditSelectTag = new ObservableCollection <mbc_db_tagtype>(); return; } var result = this.TagCollection.Where(l => from.Exists(k => k == l.Name)); this.EditSelectTag.Clear(); ObservableCollection <mbc_db_tagtype> collection = new ObservableCollection <mbc_db_tagtype>(); foreach (var item in result) { collection.Add(item); } this.EditSelectTag = collection; } else if (command == "Button.Click.Play") { if (this.SelectedItem == null) { return; } PlayerDialog player = new PlayerDialog(); player.Source = new Uri(this.SelectedItem.Url, UriKind.Absolute); List <TimeFlagViewModel> times = new List <TimeFlagViewModel>(); var model = await await MessageService.ShowWaittingResultMessge(() => { string id = this.SelectedItem?.ID; return(this.Respository.GetMovieWIthDetial(id)); }); if (model.Item2 != null) { foreach (var item in model.Item2) { bool b = TimeSpan.TryParse(item.TimeSpan, out TimeSpan span); if (!b) { continue; } times.Add(new TimeFlagViewModel() { DisPlay = item.Text, TimeSpan = span }); } player.Times = times.ToObservable(); } player.FlagClick += async(l, k) => { TimeSpan time = player.GetTime(); var flag = new TimeFlagViewModel() { TimeSpan = time }; mbc_dv_movieimage image = new mbc_dv_movieimage(); string imageFile = await player.BeginShootCut(); if (!File.Exists(imageFile)) { return; } image.Image = ImageService.BitmapSourceToString(new BitmapImage(new Uri(imageFile, UriKind.Absolute))); bool r = await MessageService.ShowObjectWithPropertyForm(flag, null, "请输入标记信息", 1); if (!r) { return; } image.MovieID = this.SelectedItem.ID; image.Text = flag.DisPlay; image.TimeSpan = time.ToString(); await this.Respository.AddMovieImage(image); times = new List <TimeFlagViewModel>(); model = await await MessageService.ShowWaittingResultMessge(() => { string id = this.SelectedItem?.ID; return(this.Respository.GetMovieWIthDetial(id)); }); if (model.Item2 != null) { foreach (var item in model.Item2) { times.Add(new TimeFlagViewModel() { DisPlay = item.Text, TimeSpan = TimeSpan.Parse(item.TimeSpan) }); } player.Times = times.ToObservable(); } }; MessageService.ShowWithLayer(player); } }
//그리드 초기화 private void InitGrid() { ArrayList list = new ArrayList(); switch (base.GetHelpID) { case "H_CZ_SM_PITEM_SUB1": //수주에서 사용 : 계약번호 연결된 아이템만 보여줌 list.Add(new object[] { "CD_ITEM", "아이템코드", 80 }); list.Add(new object[] { "NM_ITEM", "아이템명", 100 }); list.Add(new object[] { "STND_ITEM", "규격", 100 }); list.Add(new object[] { "UNIT_SO", "수주단위", 80 }); list.Add(new object[] { "UNIT_IM", "재고단위", 80 }); list.Add(new object[] { "TP_ITEM", "품목타입", 80 }); list.Add(new object[] { "CD_SL", "창고코드", 80 }); list.Add(new object[] { "NM_SL", "창고명", 100 }); list.Add(new object[] { "UNIT_SO_FACT", "수주단위수량", 80 }); list.Add(new object[] { "LT_GI", "출하LT", 80 }); list.Add(new object[] { "WEIGHT", "중량", 80 }); list.Add(new object[] { "UNIT_WEIGHT", "중량단위", 80 }); //list.Add(new object[] { "YN_ATP", "ATP적용여부", 210 }); //list.Add(new object[] { "CUR_ATP_DAY", "ATP적용기한", 210 }); list.Add(new object[] { "GRP_MFG", "제품군", 80 }); list.Add(new object[] { "NM_GRP_MFG", "제품군명", 100 }); list.Add(new object[] { "CD_CONTRACT", "계약코드", 80 }); list.Add(new object[] { "SEQ", "계약품목항번", 80 }); list.Add(new object[] { "QT_SO", "수량", 80 }); list.Add(new object[] { "UM_SO", "단가", 80 }); list.Add(new object[] { "RATE", "요율", 80 }); //list.Add(new object[] { "AM_SO", "수주금액", 210 }); //list.Add(new object[] { "AM_WONAMT", "수주금액(원화)", 210 }); //list.Add(new object[] { "AM_VAT", "부가세", 210 }); //list.Add(new object[] { "AMVAT_SO", "합계금액", 210 }); list.Add(new object[] { "PARTNER", "주거래처", 80 }); list.Add(new object[] { "LN_PARTNER", "주거래처명", 100 }); list.Add(new object[] { "REMARK", "비고", 120 }); break; case "H_CZ_SM_PITEM_SUB": //아이템 도움창 case "H_CZ_SM_PITEM_PUIV_SUB": //지출결의등록(일반경비)에서 사용 : 회계계정매핑등록에 연결된 아이템만 보여줌 list.Add(new object[] { "CD_ITEM", "아이템코드", 100 }); list.Add(new object[] { "NM_ITEM", "아이템명", 150 }); list.Add(new object[] { "EN_ITEM", "아이템명(영) ", 100 }); list.Add(new object[] { "DTS_INSERT", "입력일자", 150 }); list.Add(new object[] { "STND_ITEM", "규격", 100 }); list.Add(new object[] { "STND_DETAIL_ITEM", "세부규격", 100 }); list.Add(new object[] { "UNIT_IMNM", "재고단위", 70 }); list.Add(new object[] { "CLS_ITEMNM", "아이템계정명", 100 }); list.Add(new object[] { "NM_GRP_MFG", "제품군명", 100 }); list.Add(new object[] { "NM_MAKER", "모델명", 100 }); list.Add(new object[] { "TP_ITEM", "아이템타입", 80 }); list.Add(new object[] { "NM_TPITEM", "아이템타입명", 100 }); list.Add(new object[] { "GRP_MFG", "아이템군", 80 }); list.Add(new object[] { "NM_GRP_MFG", "아이템군명", 100 }); list.Add(new object[] { "MAT_ITEM", "재질", 100 }); list.Add(new object[] { "GRP_ITEM", "예산계정", 100 }); list.Add(new object[] { "NM_GRP_ITEM", "예산계정명", 100 }); break; case "H_CZ_SM_PITEM_SUB4": list.Add(new object[] { "CD_PITEM", "아이템코드", 100 }); list.Add(new object[] { "NM_PITEM", "아이템명", 150 }); list.Add(new object[] { "EN_ITEM", "아이템명(영) ", 100 }); list.Add(new object[] { "STND_ITEM", "규격", 100 }); list.Add(new object[] { "STND_DETAIL_ITEM", "세부규격", 100 }); list.Add(new object[] { "UNIT_IMNM", "재고단위", 70 }); list.Add(new object[] { "CLS_ITEMNM", "아이템계정명", 100 }); list.Add(new object[] { "NM_GRP_MFG", "제품군명", 100 }); list.Add(new object[] { "NM_MAKER", "모델명", 100 }); list.Add(new object[] { "TP_ITEM", "아이템타입", 80 }); list.Add(new object[] { "NM_TPITEM", "아이템타입명", 100 }); list.Add(new object[] { "GRP_MFG", "아이템군", 80 }); list.Add(new object[] { "NM_GRP_MFG", "아이템군명", 100 }); list.Add(new object[] { "MAT_ITEM", "재질", 100 }); //list.Add(new object[] { "GRP_ITEM", "예산계정", 100 }); //list.Add(new object[] { "NM_GRP_ITEM", "예산계정명", 100 }); break; } if (base.GetHelpID == "H_CZ_SM_PITEM_SUB") { if (GetListParam.Count > 0) { if (GetListParam[0] != string.Empty) { 아이템타입 = GetListParam[0]; } } if (GetListParam.Count > 1) { if (GetListParam[1] != string.Empty) { 아이템군 = GetListParam[1]; } } } // 상단 조회조건 string strQuery = string.Format(@" SELECT '' AS CD_SYSDEF, '' AS NM_SYSDEF FROM MA_CODEDTL UNION SELECT CD_SYSDEF, NM_SYSDEF FROM MA_CODEDTL WHERE CD_FIELD = 'MA_B000011' AND CD_COMPANY = '{0}' AND USE_YN = 'Y' ", Global.MainFrame.LoginInfo.CompanyCode); DataTable dt품목타입 = DBHelper.GetDataTable(strQuery); cbo품목타입S.DataSource = dt품목타입.Copy(); cbo품목타입S.DisplayMember = "NM_SYSDEF"; cbo품목타입S.ValueMember = "CD_SYSDEF"; if (아이템타입 != string.Empty) { cbo품목타입S.SelectedValue = 아이템타입; } else { cbo품목타입S.SelectedIndex = 0; } strQuery = string.Format(@"SELECT CD_SYSDEF, NM_SYSDEF, CD_FLAG1 FROM MA_CODEDTL WHERE CD_FIELD = 'MA_B000066' AND CD_COMPANY = '{0}' AND USE_YN = 'Y' ", Global.MainFrame.LoginInfo.CompanyCode); DataTable dt아이템군 = DBHelper.GetDataTable(strQuery); cbo아이템군.DataSource = dt아이템군.Copy(); cbo아이템군.DisplayMember = "NM_SYSDEF"; cbo아이템군.ValueMember = "CD_SYSDEF"; if (아이템군 != string.Empty) { cbo아이템군.SelectedValue = 아이템군; cbo품목타입S.Enabled = false; } else { cbo아이템군.SelectedIndex = -1; } cbo아이템군.Enabled = false; string strFilter = string.Format(@" CD_FLAG1 = '{0}' ", cbo품목타입S.SelectedValue); dt아이템군.DefaultView.RowFilter = strFilter; SetControl setctr = new SetControl(); setctr.SetCombobox(cbo공장코드S, MF.GetCode(MF.코드.MASTER.공장)); setctr.SetCombobox(cbo계정구분S, MF.GetCode(MF.코드.MASTER.품목.품목계정, true)); base.InitGrid(flex, list); if (base.GetHelpID == "H_CZ_SM_PITEM_SUB") { flex.Cols["DTS_INSERT"].DataType = typeof(string); flex.Cols["DTS_INSERT"].Format = "####/##/##/##:##:##"; flex.Cols["DTS_INSERT"].TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.RightCenter; flex.SetStringFormatCol("DTS_INSERT"); } flex.SettingVersion = "1.3.4"; cbo품목타입S.SelectionChangeCommitted += new EventHandler(cbo품목타입S_SelectionChangeCommitted); }
internal ucStartPanel(SetControl viewChanger) { InitializeComponent(); this.viewChanger = viewChanger; }
internal ucGame(SetControl viewChanger) { InitializeComponent(); this.viewChanger = viewChanger; this.Load += new EventHandler(UcGame_CreateBackBuffer); this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); Size tmpSize = new Size(60, 80); spaceShip = new cSpaceship() { Image = Properties.Resources.SpaceShip, Location = new Point((this.Width - tmpSize.Width) / 2, (this.Height - 150)), Size = tmpSize, Damage = 200, DamageOnContact = 50000, WeaponStrength = 1, WeaponFrequency = 1, Health = 1000, HealthMax = 1000, ShieldMax = 1000 }; invMissile = new InvaderMissile(InvaderMissileHandler); dropItem = new DropItem(DropItemHandler); invMissiles = new List <cMissile>(); missiles = new List <cMissile>(); invaderRows = new List <cInvaderRow>(); dropItems = new List <cDropItem>(); GameTimer = new Timer(); GameTimer.Interval = 15; GameTimer.Tick += GameTimer_Tick; MovementTimer = new Timer(); MovementTimer.Interval = 5; MovementTimer.Tick += MovementTimer_Tick; FireTimer = new Timer(); FireTimer.Interval = 500; FireTimer.Tick += (sender, e) => { addSpaceshipMissile(spaceShip.WeaponStrength); }; ShieldTimer = new Timer(); ShieldTimer.Interval = 20; ShieldTimer.Tick += (sender, e) => { if (spaceShip.Shield > 0) { spaceShip.Shield -= 3; } }; RegenerationTimer = new Timer(); RegenerationTimer.Interval = 20; RegenerationTimer.Tick += (sender, e) => { if (spaceShip.Health < spaceShip.HealthMax) { spaceShip.Health += 0.3f; } }; MoveRowDownTimer = new Timer(); MoveRowDownTimer.Interval = 5000; MoveRowDownTimer.Tick += (sender, e) => { if (rowsMovedDownCount < 5) { foreach (cInvaderRow row in invaderRows) { foreach (cInvader inv in row.Invaders) { inv.MoveDown(); } } } else { MoveRowDownTimer.Stop(); } }; InvaderFireTimer = new Timer(); InvaderFireTimer.Interval = 400; InvaderFireTimer.Tick += (sender, e) => { if (bossEnemy != null) { return; } List <cInvader> invaders = new List <cInvader>(); foreach (cInvaderRow row in invaderRows) { foreach (cInvader inv in row.Invaders) { invaders.Add(inv); } } int random = r.Next(0, invaders.Count); int s = r.Next(200, 300 + level); if (invaders.Count == 0) { return; } InvaderMissileHandler(invaders[random].Location, s, false); int d = r.Next(0, invaders.Count); int t = r.Next(-1, 5); DropItemHandler(invaders[d].CenterDropLocation, invaders[d].GetDropItemType(t)); }; }