Exemplo n.º 1
0
        private void loadBytesFromFile(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            if (ofd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            byteviewer.SetFile(ofd.FileName);
        }
Exemplo n.º 2
0
 private void iTalk_Button_11_Click(object sender, EventArgs e)
 {
     openFile.Title      = "F.C.E. 365 Firmware Manager - Import Binary File";
     openFile.DefaultExt = "All files *.*";
     openFile.FileName   = "Choose file...";
     if (openFile.ShowDialog() == DialogResult.OK)
     {
         _myByteViewer.SetFile(openFile.FileName);
     }
 }
Exemplo n.º 3
0
        public fcehex()
        {
            InitializeComponent();
            _myByteViewer = new System.ComponentModel.Design.ByteViewer {
                Dock = DockStyle.Fill, BorderStyle = BorderStyle.None
            };
            viewerPanel.Controls.Add(_myByteViewer);
            string pat1 = Application.StartupPath;

            try
            {
                _myByteViewer.SetFile(pat1 + "/Data/hex.dump");
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 4
0
        private void BukaFile()
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = "c:\\";
            openFileDialog1.Filter           = "Hex Files|*.HEX";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    readDataFromFile(openFileDialog1.FileName);
                    byteviewer.SetFile(openFileDialog1.FileName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Gagal membuka file: " + ex.Message);
                }
            }
        }
Exemplo n.º 5
0
		//private void DoVSExportActiveProject(object aSender, EventArgs e) {
		//    if (!ValidationHelpers.ValidateCurrentProjectNotNull()) {
		//        AddMessage("No project to export.");
		//        return;
		//    }
		//    if (OtaUtils.CurrentIdeVersion == 1) {
		//        AddMessage("C#Builder 1.0 is not supported.");
		//        return;
		//    }
		//    string bdsFile = OtaUtils.GetCurrentProject().FileName;
		//    string vsFile;
		//    if (ValidationHelpers.ValidateCurrentProjectIsCSharp())
		//    {
		//        vsFile = Path.ChangeExtension(bdsFile, "csproj");
		//    } else if (ValidationHelpers.ValidateCurrentProjectIsVB()) {
		//        vsFile = Path.ChangeExtension(bdsFile, "vbproj");
		//    } else {
		//        AddMessage("Only C# and VB projects can be exported. Current project is " + bdsFile);
		//        return;
		//    }

		//    string xsltFile = GetXsltFile();
		//    AddMessage("Visual Studio Conversion Tool");
		//    AddMessage("Using transform document: " + xsltFile);
		//    AddMessage("Input file: " + bdsFile);
		//    AddMessage("Output file: " + vsFile);

		//    try {
		//        Lextm.Xml.XmlConvertor.ConvertXmlUsingXsl(bdsFile,
		//                                xsltFile,
		//                                vsFile);
		//        AddMessage("Done.");
		//    } catch (Exception ex) {
		//        Lextm.Windows.Forms.MessageBoxFactory.Fatal(ex);
		//    }

		//}
		
		//private static string GetXsltFile() {
		//    return OtaUtils.GetIdeRootDir() + @"Bin\VSExport.xsl";
		//}
		
//		protected void DoStartProjectTarget(object aSender, EventArgs e) {
//			if (!ValidationHelpers.ValidateCurrentProjectTargetExists()) {
//				return;
//			}
//
//			string _Target = OTAUtils.GetProjectTarget(OTAUtils.GetCurrentProject());
//			Process.Start(_Target);
//		}

		private void DoViewModuleHexDump(object aSender, EventArgs AEventArgs) {
			if (!ValidationHelpers.ValidateCurrentEditorNotNull()) {
				return;
			}
			// TODO: make it non-modal.
			string _FileName = OtaUtils.GetCurrentEditorFileName();

			FrmViewHexaDump _Frm = new FrmViewHexaDump();

			ByteViewer _Ctr = new ByteViewer();
			_Ctr.SetDisplayMode(DisplayMode.Hexdump);
			_Ctr.SetFile(_FileName);
			_Ctr.Dock = DockStyle.Fill;
			_Frm.pnlHost.Controls.Add(_Ctr);
			_Frm.ShowDialog();
		}