private void install_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { string addinpath = @"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Autodesk\Revit\Addins\2017\" + DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".addin"; string dllpath = Dll.repeatFileName(@"C:\Users\" + Environment.UserName + @"\AppData\Roaming\Autodesk\Revit\Addins\2017\" + Path.GetFileName(ofd.FileName)); //MessageBox.Show(dllpath); File.Copy(Path.GetFullPath(ofd.FileName), dllpath); Dll d = new Dll(dllpath); StreamWriter sw = new StreamWriter(addinpath); sw.WriteLine(d.exportAddin()); sw.Close(); MessageBox.Show("Success Save to \"" + d.toString() + "\" and create .addin manifest file.", "Success Install", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.Close(); } }
private void browse_Click(object sender, EventArgs e) { classes.Items.Clear(); allClass = new List <exClass>(); openFileDialog.ShowDialog(); location.Text = openFileDialog.FileName; path = openFileDialog.FileName; if (Path.GetExtension(path) == ".dll") { dll = new Dll(path); int i = 0; foreach (exClass t in dll.Classes) { classes.Items.Add(t); } } else { } }
public AddinInfo(string path) { InitializeComponent(); dll = new Dll(path); }