Exemple #1
0
        // Setup the main window for display.
        private void InitializeComponent()
        {
            // increment the # of open windows; this is decremented in
            // _on_file_close_click
            ++m_instances;

            Text = Localization.GUI_WINDOW_TITLE;

            m_infop.AssemblyActivated +=
                new AssemblyInformationPanel.ItemActivateEventHandler(
                    _on_assembly_activated);

            // enable OLE drag and drop.
            AllowDrop = true;

            _init_menu();

            // hide the info pane.
            _on_view_info_click(this, null);

            // The type of assembly loading is dependant on m_lai.
            _set_assembly_load(m_lai.LoadAs());

            // setup viewing of information panel when a tree node is selected.
            TreeView.AfterSelect += new TreeViewEventHandler(_on_tree_node_select);
            TreeView.ContextMenu  = new TreeContextMenu(TreeView);

            m_help.Text = Localization.GUI_INTRO_TEXT;
            InfoPane.Controls.Add(m_help);

            _reset_interface();
        }
Exemple #2
0
        // Create a LoadAssembly object based on ``i''.
        //
        // If ``i.LoadAs()'' doesn't return a value from the AssemblyLoadAs
        // enumeration, then an exception is thrown.
        public static LoadAssembly CreateLoader(LoadAssemblyInfo i)
        {
            Trace.WriteLine("Creating Assembly Loader for:");
            Trace.WriteLine("  LoadAs: " + i.LoadAs().ToString());
            Trace.WriteLine("  AppBasePath: " + i.AppPath());
            Trace.WriteLine("  RelativeSearchPath: " + i.RelPath());

            _creator c = (_creator)m_tbl[i.LoadAs()];

            if (c == null)
            {
                throw
                    new Exception("Internal error: Invalid AssemblyLoadAs specified");
            }

            return(c(i));
        }
Exemple #3
0
        // Create the window.  No assemblies will be displayed.
        public DependenciesForm(LoadAssemblyInfo lai)
        {
            m_lai = new LoadAssemblyInfo();
            m_lai.LoadAs(lai.LoadAs());
            m_lai.AppPath(lai.AppPath());
            m_lai.RelPath(lai.RelPath());

            InitializeComponent();
        }
Exemple #4
0
        // Parse the command line given by ``args''.
        public ParseOptions(string[] args)
        {
            /*
             * if someone actually wants to list the dependancies of a file named
             * "--help", they don't want ``--help'' to be interpreted as a program
             * argument.  To disable parsing of program arguments, use ``--'', e.g.
             *    adepends -- --help
             */
            bool parse_opts = true;

            for (int i = 0; i < args.Length; i++)
            {
                string arg = args[i];

                if (parse_opts)
                {
                    if (_help_message(arg))
                    {
                        m_help = true;
                    }
                    else if (_use_console(arg))
                    {
                        m_gui = false;
                    }
                    else if (_use_gui(arg))
                    {
                        m_gui = true;
                    }
                    else if (_use_current_process(arg))
                    {
                        m_cur = true;
                    }
                    else if (_load(arg))
                    {
                        string s = _next(args, ref i, arg);
                        try
                        {
                            m_lai.LoadAs((AssemblyLoadAs)Enum.Parse(
                                             typeof(AssemblyLoadAs), s, true));
                        }
                        catch
                        {
                            throw new BadParameterException(
                                      String.Format(Localization.FMT_BAD_PARAMETER, arg, s));
                        }
                    }
                    else if (_app_base(arg))
                    {
                        m_lai.AppPath(_next(args, ref i, arg));
                    }
                    else if (_rels(arg))
                    {
                        m_lai.RelPath(_next(args, ref i, arg));
                    }
                    else if (_config(arg))
                    {
                        m_config = _next(args, ref i, arg);
                    }
                    else if (arg == "--")
                    {
                        parse_opts = false;
                    }
                    else
                    {
                        m_files.Add(arg);
                    }
                }
                else
                {
                    m_files.Add(arg);
                }
            }
        }