Exemple #1
0
        /// <summary>
        /// Browse project packages
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void packageBrowse_Click(object sender, EventArgs e)
        {
            PackageBrowser browser = new PackageBrowser();

            browser.Project = this.Project;

            foreach (string item in Project.AbsoluteClasspaths)
            {
                browser.AddClassPath(item);
            }

            if (browser.ShowDialog(this) == DialogResult.OK)
            {
                if (browser.Package != null)
                {
                    string classpath = this.Project.AbsoluteClasspaths.GetClosestParent(browser.Package);
                    string package   = Path.GetDirectoryName(ProjectPaths.GetRelativePath(classpath, Path.Combine(browser.Package, "foo")));
                    if (package != null)
                    {
                        directoryPath        = browser.Package;
                        package              = package.Replace(Path.DirectorySeparatorChar, '.');
                        this.packageBox.Text = package;
                    }
                }
                else
                {
                    this.directoryPath   = browser.Project.Directory;
                    this.packageBox.Text = "";
                }
            }
        }
        /// <summary>
        /// Browse project packages
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void packageBrowse_Click(object sender, EventArgs e)
        {

            PackageBrowser browser = new PackageBrowser();
            browser.Project = this.Project;

            foreach (string item in Project.AbsoluteClasspaths)
                browser.AddClassPath(item);

            if (browser.ShowDialog(this) == DialogResult.OK)
            {
                if (browser.Package != null)
                {
                    string classpath = this.Project.AbsoluteClasspaths.GetClosestParent(browser.Package);
                    string package = Path.GetDirectoryName(ProjectPaths.GetRelativePath(classpath, Path.Combine(browser.Package, "foo")));
                    if (package != null)
                    {
                        directoryPath = browser.Package;
                        package = package.Replace(Path.DirectorySeparatorChar, '.');
                        this.packageBox.Text = package;
                    }
                }
                else
                {
                    this.directoryPath = browser.Project.Directory;
                    this.packageBox.Text = "";
                }
            }
        }