public Bitmap DrawFrame(FrmMain frm) { Bitmap bufferimage = new Bitmap(Pos.Width, Pos.Height); Graphics graf = Graphics.FromImage(bufferimage); graf.Clear(frm.BackColor); //draw buffle buffle.DrawBoard(graf); //draw ball foreach (Ball thisball in balls) { thisball.DrawBall(graf); } //draw brick foreach (Brick thisbrick in bricks) { thisbrick.DrawBrick(graf); } //draw items foreach (Item thisitem in items) { thisitem.DrawItem(graf); } graf.Dispose(); return bufferimage; }
public Bitmap DrawFrame(FrmMain frm) { Bitmap bufferimage = new Bitmap(frm.Width, frm.Height); Graphics graf = Graphics.FromImage(bufferimage); graf.Clear(frm.BackColor); //draw frame Pen framepen = new Pen(Color.Black, 2.0f); graf.DrawRectangle(framepen, new Rectangle(Pos.Left - 5, Pos.Top - 5, Pos.Width + 10, Pos.Height + 10)); //draw buffle buffle.DrawBoard(graf); //draw ball foreach (Ball thisball in balls) { thisball.DrawBall(graf); } //draw brick foreach (Brick thisbrick in bricks) { thisbrick.DrawBrick(graf); } //draw items foreach (Item thisitem in items) { thisitem.DrawItem(graf); } graf.Dispose(); return bufferimage; }
public FileWatcher(FrmMain frmMain) { _frmMain = frmMain; // list to store all fileWatchers for each upload _watcherList = new List<FileWatchers>(); List<SiteConf.Upload.Object> uploadList = null; // checked if orgSite is an Admin if (_frmMain._orgSite.HVPAdmin.HasValue) { if (_frmMain._orgSite.HVPAdmin.Value) { // get all the orgsites associated with the admin site List<SiteConf.OrgSite.Object> sites = DataLoader.GetAdminOrgSites(_frmMain._orgSite.ID); // concatenated list of uploads uploadList = new List<SiteConf.Upload.Object>(); // get all the uploads for each site foreach (SiteConf.OrgSite.Object site in sites) { List<SiteConf.Upload.Object> uploads = DataLoader.GetUploadList(site.OrgHashCode); uploadList = uploadList.Concat(uploads).ToList(); } } } // if orgSite is not admin then just get the uploads using the hashcode from it. if (uploadList == null) uploadList = DataLoader.GetSpreadSheetUploadList(_frmMain._orgSite.OrgHashCode); foreach (SiteConf.Upload.Object upload in uploadList) { if (upload.DataSourceName == null || upload.DataSourceName == string.Empty) { continue; } else { try { FileWatchers fw = new FileWatchers(); fw.FileWatcher = StartWatching(upload.DataSourceName); fw.Upload = upload; _watcherList.Add(fw); } catch { MessageBox.Show("The directory location path for " + upload.Name + " can not be found please check if the path name is correct.", "Spreadsheet directory path error"); } } } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FrmMain form = new FrmMain(); if (args.Length > 0 && File.Exists(args[0])) form.setFileToOpen(args[0]); Application.Run(form); }
public DiaParameter(FrmMain owner) { InitializeComponent(); //设置FrmMain为父窗体,可以读取父窗体数据 father = owner; XmlDocument doc = father.ComplexNet.ToXML(); curNetwork = new pNet(doc); }
public StyleSet GlobalPaintStyle; // 全局变量 绘图风格 public FrmComBehavior(FrmMain owner) { InitializeComponent(); //设置FrmMain为父窗体,可以读取父窗体数据 father = owner; GlobalPaintStyle = father.GlobalPaintStyle; PicWidth = father.PicWidth; PicHeight = father.PicHeight; XmlDocument doc = father.ComplexNet.ToXML(); curNetwork = new bNet(doc, GlobalPaintStyle); }
//Constructor #1 public TCP_Server(IPEndPoint Ip_Addr, FrmMain Frmmain) { //Init Main frm TCP_Globals.frmMain = Frmmain; //Init network variables #region Network Init TCP_Globals.IPAddrListen = Ip_Addr; TCP_Globals.TcpListen = new TcpListener(TCP_Globals.IPAddrListen); #endregion //Start listen StartListen(); }
public OSm4shModelCreator(FrmMain parent) { InitializeComponent(); parentForm = parent; }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { HandleBandChange(mainForm.ContestDataProvider.FocusedRadio); }
public FrmEditSuratKeluar(FrmMain _frmmain, string _nomor_agenda) { InitializeComponent(); this.frmMain = _frmmain; this.nomor_agenda = _nomor_agenda; }
public Serializer(FrmMain main) { m_Main = main; }
public FrmPopUpBrowser(Form callingForm) { mainfrm = callingForm as FrmMain; InitializeComponent(); }
private void btnFindLocation_Click(object sender, EventArgs e) { parentForm.checkInternetConnection(false); if (parentForm.internetAvailable == false) { parentForm.showNoInternetMessage(); return; } // Alternative Weather calls HERE: https://www.obioberoi.com/2018/07/14/how-to-pull-weather-info-into-a-console-app/ var client = new OpenWeatherAPI.OpenWeatherAPI(Constants.OpenWeatherAPIKey); //YOUR-API-KEY Query results; // = null; try { results = client.Query(txtSearch.Text); } catch (ArithmeticException) { results = null; } // -34.206841, 138.599503); //var results = client.Query("Adelaide"); if (results == null) { btnSetLocation.Enabled = false; lblCityFound.Text = "City Not Found. "; foundCityLat = 0; foundCityLong = 0; foundCityName = string.Empty; MessageBox.Show("There was a problem getting the weather. \nThe internet connection may be unavailable \nOr the city name is not known."); return; } if (results.ValidRequest == false) { btnSetLocation.Enabled = false; lblCityFound.Text = "City Not Found. "; foundCityLat = 0; foundCityLong = 0; foundCityName = string.Empty; MessageBox.Show("There was a problem getting the weather. \nThe internet connection may be unavailable \nOr the city name is not known."); return; } // if we get to here then its a valid result btnSetLocation.Enabled = true; foundCityLat = results.Coord.Latitude; foundCityLong = results.Coord.Longitude; foundCityName = results.Name; txtSearch.Text = results.Name; lblCityFound.Text = "Found: " + results.Name; btnSetLocation.BackColor = Color.PeachPuff; FrmMain.showWeatherReport(results, true); }
private void tlpCoupon_Paint(object sender, PaintEventArgs e) { FrmMain.ShadowPanel(sender, e); }
private void Btn4_Click(object sender, RoutedEventArgs e) { FrmMain.Navigate(new Page3()); }
public void Visibility(FrmMain form) { form.Go(); }
public MainWindow() { InitializeComponent(); FrmMain.Navigate(new MainPage()); }
private void Btn3_Click(object sender, RoutedEventArgs e) { FrmMain.Navigate(new PageListUser()); }
public ContactControl(FrmMain frmMain, CredentialsDetails credentialsDetails) { FrmMain = frmMain; CredentialsDetails = credentialsDetails; InitializeComponent(); }
private void lblWallpaperModesExplained_Click(object sender, EventArgs e) { FrmMain.OpenModesURL(); }
private void btnOpenWallpaperFolder_Click(object sender, EventArgs e) { string argument = @"/select, " + Wallpaper.GetWallpaperPath(parentForm.wallpaperFileNum, FrmMain.getWallpaperExtension(parentForm.settings.WallpaperFormat)); System.Diagnostics.Process.Start("explorer.exe", argument); }
private void dataGridViewPrescricoes_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { try { string _justificativa = string.Empty; DataGridView sendGrid = (DataGridView)sender; DataRow dataRow = table.Rows[e.RowIndex]; if (sendGrid.Columns[e.ColumnIndex] is DataGridViewImageColumn) { if (e.ColumnIndex >= 2 && dataGridViewPrescricoes.Columns[e.ColumnIndex].Name != "Act") { DateTime dateTime = Convert.ToDateTime(dataGridViewPrescricoes.Columns[e.ColumnIndex].HeaderText); if (dateTime.Equals(DateTime.Now.Date)) { if (Sessao.Usuario.Perfil.HasFlag(Perfil.Enfermeiro_Assistemcial) || Sessao.Usuario.Perfil.HasFlag(Perfil.Tecnico)) { TimeSpan time = (TimeSpan)dataGridViewPrescricoes["Horário", e.RowIndex].Value; if (DateTime.Now.TimeOfDay - time > new TimeSpan(1, 0, 59) || DateTime.Now.TimeOfDay - time < new TimeSpan(-1, 0, 59)) { string msgBox = "Essa linha de prescrição, tem mais de 1:00 atrasada ou adiantada do horario previsto."; msgBox += "\nDeseja realizar a checagem e justificar o motivo."; if (MessageBox.Show(msgBox, "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { table.Columns["Justificativa"].ReadOnly = false; DialogResult dialog = new Frm.FrmJustificarChecagem(dataRow).ShowDialog(); table.Columns["Justificativa"].ReadOnly = true; if (dialog != DialogResult.OK) { return; } else { sendGrid.Rows[e.RowIndex].Cells["Justificativa"].ReadOnly = false; _justificativa = sendGrid.Rows[e.RowIndex].Cells["Justificativa"].Value.ToString(); sendGrid.Rows[e.RowIndex].Cells["Justificativa"].ReadOnly = true; presenterGeneric.Salvar(new PrescricaoMedica() { Id = Convert.ToInt32(table.Rows[e.RowIndex]["Id"]), IdPaciente = Sessao.Paciente.Id, IdChavePrescricao = Convert.ToInt32(table.Rows[e.RowIndex]["IdChavePrescricao"]), Justificativa = _justificativa }, Procedure.SP_UPDT_JUSTIFICATIVA, Acao.Atualizar); } } else { return; } } } else { return; } if (dataGridViewPrescricoes.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag == null || (int)dataGridViewPrescricoes.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag == 0) { dataGridViewPrescricoes.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = Properties.Resources.IsOk; dataGridViewPrescricoes.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag = 1; } else { dataGridViewPrescricoes.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = Properties.Resources.Wait; dataGridViewPrescricoes.Rows[e.RowIndex].Cells[e.ColumnIndex].Tag = 0; } presenterGeneric.Salvar(new CicloPrescricao() { Id = Convert.ToInt32(table.Columns[e.ColumnIndex].ExtendedProperties["Id"]), IdPaciente = Sessao.Paciente.Id, IdPrescricao = dataGridViewPrescricoes.Rows[e.RowIndex].Cells[0].Value.ToString(), IdChavePrescricao = Convert.ToInt32(table.Rows[e.RowIndex]["IdChavePrescricao"]), Checado = DateTime.Now, }, Procedure.SP_ADD_DATE, Acao.Atualizar); } else { MessageBox.Show("Não é permitido realizar checagem de cuidados prescritos em datas passadas ou futuras", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } else if (sendGrid.Columns[e.ColumnIndex].Name.Equals("Justificativa")) { new Frm.FrmJustificarChecagem(dataRow, false).ShowDialog(); } } catch (Exception exChekPrescricao) { FrmMain.Alert(100, exChekPrescricao); } }
public DrawingObjectInfo(string pbHander, FrmMain frmmain, ref SGWorld66 sgworld) : this(pbHander, ref sgworld) { FrmMain = frmmain; }
public static string SaveWallpaper(Bitmap bmp, int vFileNum, ImageFormat vFormat, int vQuality, String vSettingsFullPath) { //System.Drawing.Imaging.EncoderParameter qualityParam = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, vQuality); //System.Drawing.Imaging.EncoderParameters encoderParams = new System.Drawing.Imaging.EncoderParameters(1); //encoderParams.Param[0] = qualityParam; ImageCodecInfo jpgEncoder = GetEncoder(vFormat); // ImageFormat.Jpeg); // Create an Encoder object based on the GUID // for the Quality parameter category. System.Drawing.Imaging.Encoder myEncoder = System.Drawing.Imaging.Encoder.Quality; // Create an EncoderParameters object. // An EncoderParameters object has an array of EncoderParameter // objects. In this case, there is only one // EncoderParameter object in the array. EncoderParameters myEncoderParameters = new EncoderParameters(1); EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, (long)vQuality); myEncoderParameters.Param[0] = myEncoderParameter; //bmp.Save(@"c:\TestPhotoQualityFifty.jpg", jpgEncoder, myEncoderParameters); //string root = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); //.CommonPictures); //.MyPictures); string path = GetWallpaperPath(vFileNum, FrmMain.getWallpaperExtension(vFormat));//Path.Combine(root, "LAWC_Image.bmp"); try { bmp.Save(path, jpgEncoder, myEncoderParameters); //using (MemoryStream memory = new MemoryStream()) //{ // using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite)) // { // EncoderParameters e = new EncoderParameters(); // //bmp.Save(memory, ImageFormat.Png); // //bmp.Save(memory, ImageFormat.Jpeg); // //bmp.Save(memory, vFormat); // bmp.Save(memory, vFormat, encoderParams); // byte[] bytes = memory.ToArray(); // fs.Write(bytes, 0, bytes.Length); // } //} return(path); } catch (IOException ex) { Boolean vLogged = false; //WriteError("Wallpaper Error 001: Unable to save wallpaper " + path + "\n" + ex.Message, true); new ApplicationException(string.Format(CultureInfo.InvariantCulture, "Problem Saving Wallpaper: " + path + ""), ex).Log(ref vLogged, vSettingsFullPath); return(string.Empty); } //return path; }
public static void Cleanup(Control quickConnectToolStrip, ExternalToolsToolStrip externalToolsToolStrip, MultiSshToolStrip multiSshToolStrip, FrmMain frmMain) { try { StopPuttySessionWatcher(); DisposeNotificationAreaIcon(); SaveConnections(); SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip, frmMain); UnregisterBrowsers(); } catch (Exception ex) { Runtime.MessageCollector.AddExceptionStackTrace(Language.strSettingsCouldNotBeSavedOrTrayDispose, ex); } }
internal void OpenUCUpdateAutomobil(FrmMain frmMain) { frmMain.SetPanel(new UCUpdateAutomobil(new AutomobilController())); }
private static void SaveSettings(Control quickConnectToolStrip, ExternalToolsToolStrip externalToolsToolStrip, MultiSshToolStrip multiSshToolStrip, FrmMain frmMain) { Config.Settings.SettingsSaver.SaveSettings(quickConnectToolStrip, externalToolsToolStrip, multiSshToolStrip, frmMain); }
public FrmSuratMasuk(FrmMain _frmMain) { InitializeComponent(); frmMain = _frmMain; this.ShowInTaskbar = false; }
public void Initialize(FrmMain main) { }
public FrmLogin(FrmMain _frmMain) { InitializeComponent(); frmMain = _frmMain; this.ShowInTaskbar = false; }
internal static bool Show(Form owner, Core core) { using (FrmWizConfigurationCluster frm = new FrmWizConfigurationCluster(core, FrmMain.SearchForSelectedPeak(owner))) { return(UiControls.ShowWithDim(owner, frm) == DialogResult.OK); } }
public UCSchema(FrmMain Root) { root = Root; InitializeComponent(); }
public DiaNodeInfo(FrmMain owner) { InitializeComponent(); //设置FrmMain为父窗体,可以读取父窗体数据 father = owner; }
/// <summary> /// Creates new plugin manager. /// </summary> /// <param name="frmMain">Main window</param> public PluginManager(FrmMain frmMain) { this.frmMain = frmMain; }
/// <summary> /// 保存到C库 /// </summary> private void SaveC() { string strID = this.gridList.CurrentRow.Cells["ID"].Value.ToString(); string crudeIndex = this.gridList.CurrentRow.Cells["原油编号"].Value.ToString(); int ID = 0; if (int.TryParse(strID, out ID)) { OilDataSearchAccess dataSearchAccess = new OilDataSearchAccess(); List <OilDataSearchEntity> dataList = dataSearchAccess.Get("oilInfoID =" + ID).ToList(); if (dataList.Count > 0) { DialogResult r = MessageBox.Show("原油" + crudeIndex + "的查询库数据已经存在是否替换?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (r == DialogResult.Yes) { dataSearchAccess.deleteData("Delete from OilDataSearch where oilInfoID =" + ID); OilInfoBEntity oilB = OilBll.GetOilByCrudeIndex(crudeIndex); OilInfoEntity oilA = OilBll.GetOilById(crudeIndex); if (oilA == null) { OilBll.SaveC(oilB); } else { OilBll.SaveC(oilA, oilB); } MessageBox.Show("原油" + crudeIndex + "生成查询库成功!", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information); FrmMain frmMain = this.MdiParent as FrmMain; DatabaseC.FrmOilDataC child = (DatabaseC.FrmOilDataC)frmMain.GetChildFrm(crudeIndex + "C"); if (child != null) { MessageBox.Show("原油" + crudeIndex + "的数据窗体需关闭重新打开才有效!", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information); } } } else { DialogResult r = MessageBox.Show("是否保存数据到快速查询库!", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (r == DialogResult.Yes) { dataSearchAccess.deleteData("Delete from OilDataSearch where oilInfoID =" + ID); OilInfoBEntity oilB = OilBll.GetOilByCrudeIndex(crudeIndex); OilInfoEntity oilA = OilBll.GetOilById(crudeIndex); if (oilA == null) { OilBll.SaveC(oilB); } else { OilBll.SaveC(oilA, oilB); } MessageBox.Show("原油" + crudeIndex + "生成查询库成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); FrmMain frmMain = this.MdiParent as FrmMain; DatabaseC.FrmOilDataC child = (DatabaseC.FrmOilDataC)frmMain.GetChildFrm(crudeIndex + "C"); if (child != null) { MessageBox.Show("原油" + crudeIndex + "的数据窗体需关闭重新打开才有效!", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Information); } } } } else { MessageBox.Show("应用库无此条原油!", "警告信息", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public FrmFilterMain(FrmMain _frmMain) { InitializeComponent(); this.frmMain = _frmMain; }
public FrmFilterSuratKeluar(FrmMain _frmMain) { InitializeComponent(); this.frmMain = _frmMain; }
/// <summary> /// Initializes a new instance of the <see cref="FrmMiniSearch"/> class. /// </summary> /// Created by SMK public FrmMiniSearch(FrmMain frm) : this() { this.frm = frm; }
void ItemReceived(int no, FrmMain frm) { switch (no) { case 0: this.AddBall(); break; case 1: this.MoveSlower(); break; case 2: this.LongerBuffle(); break; case 3: Energy++; frm.label2.Text = "现在小球的能量为" + Energy.ToString(); if (Energy % 5 == 0) { this.BallLevelUp(); } break; case 4: this.ShorterBuffle(); break; case 5: this.MoveQuicker(); break; } }
public string GetDbFilePath() { string dbFileName = "Lotto.db"; string dbDirectory = "data"; FrmMain frm = new FrmMain(); string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), frm.CompanyName, frm.ProductName, dbDirectory, dbFileName); return path; }
internal void OpenUCUpdateMusterija(FrmMain frmMain) { frmMain.SetPanel(new UCUpdateMusterija(new MusterijaController())); }
//构造函数 public DiaCreate(FrmMain owner) { InitializeComponent(); father = owner; }
internal void OpenUCUpdateRentiranje(FrmMain frmMain) { frmMain.SetPanel(new UCUpdateRentiranje(new Rentiranjekontroler())); }
public int UpdateData(FrmMain frm) { //main Ball thisball; int ballnum = balls.Count(); List<Ball> balltokill = new List<Ball>(); for (int i = 0; i < ballnum; i++) { thisball = balls[i]; for (float newX = thisball.CenterPositionF.X, newY = thisball.CenterPositionF.Y, t = 0; (t <= BallMoveFactor) && gamerunning; newX += (0.01f * thisball.MoveDirection.X), newY += (0.01f * thisball.MoveDirection.Y), t += 0.01f) { thisball.CenterPositionF = new PointF(newX, newY); if (this.CheckCollision(thisball)) { //ball caught collision ; } if (!gamerunning) { if (bricks_remained == 0) { //win return 1; } else { balltokill.Add(thisball); if (ballnum == balltokill.Count()) { //lose return 2; } } gamerunning = true; break; } } } foreach (Ball b in balltokill) { balls.Remove(b); } //consider items() List<Item> items_rm = new List<Item>(); foreach (Item thisitem in items) { if (thisitem.ItemFall()) { if (thisitem.ItemReceived(buffle.left - itemwidth, BuffleWidth + 2 * itemwidth)) { //item received ItemReceived(thisitem.GetItemNo(), frm); } items_rm.Add(thisitem); } } foreach (Item thisitem in items_rm) { items.Remove(thisitem); } items_rm.Clear(); //nothing happened return 0; }
public OBCHTextureReplacer(FrmMain parent) { InitializeComponent(); parentForm = parent; TopMenu.Renderer = new OMenuStrip(); }
public FrmMain() { staticInstance = this; }
private void AddNewRows() { try { List <CicloPrescricao> lstCicloItem = presenterGeneric.GetLista(new CicloPrescricao() { IdChavePrescricao = prescricaoMedica.IdChavePrescricao, IdPaciente = Sessao.Paciente.Id } , Procedure.SP_GET_CICLO); DataRow row = table.NewRow(); if (!table.Columns.Contains("Act")) { table.Columns.Add(new DataColumn("Act", typeof(Image))); } row["Id"] = prescricaoMedica.Id; row["IdCliente"] = Sessao.CodigoCliente; row["IdChavePrescricao"] = prescricaoMedica.IdChavePrescricao; row["IdPaciente"] = Sessao.Paciente.Id; row["Horário"] = TimeSpan.Parse(DateTime.Now.ToShortTimeString()); row["Prescrição"] = string.Empty; row["Justificativa"] = string.Empty; row["Act"] = Properties.Resources.rubbishbin_102620; foreach (DataColumn item in table.Columns) { if (item.DataType == typeof(Image)) { if (item.ColumnName.Equals("Act")) { continue; } if (Convert.ToDateTime(item.Caption) >= DateTime.Now.Date) { row[item.ColumnName] = Properties.Resources.Wait; } else { row[item.ColumnName] = Properties.Resources.integative; } if (table.Rows.Count == 0) { item.ExtendedProperties.Add("Id", lstCicloItem.Find(c => c.DataCiclo.Equals(Convert.ToDateTime(item.Caption))).Id); } } } table.Rows.Add(row); ConfigGrid(); btnNewLine.Enabled = table != null; btnAddDia.Visible = btnRemoveDia.Visible = table.Rows.Count > 0; } catch (Exception exNewLn) { FrmMain.Alert(100, exNewLn); } }
private void pbDonate_Click(object sender, EventArgs e) { FrmMain.OpenDonateURL(); }
public static void mfoc(FrmMain gui, int probes, int distance, string dumpName, string keys) { keys=keys.Length < 12 ? "-k b5ff67cba951 -k 44dd5a385aaf -k 21a600056cb0 -k b1aca33180a5 -k dd61eb6bce22 -k 1565a172770f -k 3e84d2612e2a -k f23442436765 -k 79674f96c771 -k 87df99d496cb -k c5132c8980bc -k a21680c27773 -k f26e21edcee2 -k 675557ecc92e -k f4396e468114 -k 6db17c16b35b -k 4186562a5bb2 -k 2feae851c199 -k db1a3338b2eb -k 157b10d84c6b -k a643f952ea57 -k df37dcb6afb3 -k 4c32baf326e0 -k 91ce16c07ac5 -k 3c5d1c2bcd18 -k c3f19ec592a2 -k f72a29005459 -k 185fa3438949 -k 321a695bd266 -k d327083a60a7 -k 45635ef66ef3 -k 5481986d2d62 -k cba6ae869ad5 -k 645a166b1eeb -k a7abbc77cc9e -k f792c4c76a5c -k bfb6796a11db" : keys; Common.CreateFiles(); Process process=new Process { StartInfo={ WindowStyle=ProcessWindowStyle.Hidden, CreateNoWindow=true, UseShellExecute=false, RedirectStandardOutput=true, FileName=System.IO.Path.GetTempPath() + @"\\mfoc.exe", Arguments=string.Concat(new object[] { "mfoc -O ", dumpName, " -P ", probes, " -T ", distance, " ", keys }) } }; // process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; // process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.Start(); process.StartInfo.WindowStyle=ProcessWindowStyle.Hidden; string val=""; val=process.StandardOutput.ReadToEnd(); if (val != null) { Log.WriteLog(LogFile.RunningTime, val); gui.updateLogBox(val); gui.updateLogBox("\n"); } process.WaitForExit(); TimeSpan span=DateTime.Now.Subtract(process.StartTime); if (val.Contains("Auth with all sectors succeeded, dumping keys to a file!")) { MessageBox.Show(string.Concat(new object[] { "完成!\n总耗时:", span.Hours, "小时", span.Minutes, "分", span.Seconds, "秒 \n 日志已记录到文件: ", dumpName })); gui.updateStatus(2); } else { // gui.updateStatus(0); MessageBox.Show("操作失败,请重试!"); gui.updateStatus(0); } }
//private readonly String imageFolder = string.Empty; public Page3(FrmMain vParentForm) { InitializeComponent(); parentForm = vParentForm; }
static void Main() { //C#+フォームの標準準備 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //フォームの準備(SlimDXではRenderFormも使用可能) var form = new FrmMain();// new RenderForm(); //終了イベントを捕捉 form.FormClosed += new FormClosedEventHandler(form_FormClosed); PresentParameters pp; //SlimDXのDeviceを準備 var device = new Device(new Direct3D(), 0, DeviceType.Hardware, form.Handle, CreateFlags.HardwareVertexProcessing, pp = new PresentParameters() { BackBufferWidth = form.ClientSize.Width, BackBufferHeight = form.ClientSize.Height }); //トゥーンテクスチャのパスを準備(SlimMMDXではトゥーンフォルダを別に用意する必要がある) string[] toonTexPath = new string[10]; string baseDir = Path.GetDirectoryName(Application.ExecutablePath); for (int i = 1; i <= 10; ++i) { toonTexPath[i - 1] = Path.Combine(baseDir, Path.Combine("toons", "toon" + i.ToString("00") + ".bmp")); } //SlimMMDXのセットアップ(他の機能よりも先に使用する) SlimMMDXCore.Setup(device, toonTexPath); //SlimMMDXCore.Instance.UsePhysics = false; //モデルの読み込み MMDModel model = SlimMMDXCore.Instance.LoadModelFromFile("Models/miku.pmd"); //モーションの読み込み MMDMotion motion = SlimMMDXCore.Instance.LoadMotionFromFile("Motions/TrueMyHeart.vmd"); //モーションのセットアップ model.AnimationPlayer.AddMotion("TrueMyHeart", motion, MMDMotionTrackOptions.UpdateWhenStopped); //時間管理フラグ long beforeCount = -1; bool deviceLost = false; //メインループ MessagePump.Run(form, () => { //経過時間を計算 float timeStep; if (beforeCount < 0) { timeStep = 0.0f; beforeCount = Stopwatch.GetTimestamp(); } else { timeStep = ((float)(Stopwatch.GetTimestamp() - beforeCount)) / (float)Stopwatch.Frequency; beforeCount = Stopwatch.GetTimestamp(); } if (PlayFlag) { model.AnimationPlayer["TrueMyHeart"].Reset(); model.PhysicsManager.Reset(); model.AnimationPlayer["TrueMyHeart"].Start(); PlayFlag = false; } //SlimMMDXCoreのUpdate処理 SlimMMDXCore.Instance.Update(timeStep); if (deviceLost) { if (device.TestCooperativeLevel() == ResultCode.DeviceNotReset) { device.Reset(pp); SlimMMDXCore.Instance.OnResetDevice(); deviceLost = false; } } if (!deviceLost) { try { //描画処理 device.BeginScene(); //画面のクリア device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.CornflowerBlue, 1.0f, 0); //モデルの描画 model.Draw(); //描画処理の終了 device.EndScene(); device.Present(Present.None); } catch (Direct3D9Exception e) { if (e.ResultCode == ResultCode.DeviceLost) { SlimMMDXCore.Instance.OnLostDevice(); deviceLost = true; } else throw; } } //速度合わせ if (timeStep < 0.016666) Thread.Sleep((int)(16.66666 - timeStep * 1000.0f)); }); //SlimMMDXの解放処理 foreach (var item in ObjectTable.Objects) item.Dispose(); }