示例#1
0
        public void LoadContent()
        {
            string[] args  = Environment.GetCommandLineArgs();
            string   sPath = ".",
                     sStdErr;

            if (args.Length > 1)
            {
                sPath = args[1].TrimEnd(m_acParamRemoveChars);
            }

            // check for URL parameter
            if (sPath.IndexOf('/') > 0)
            {
                MessageBox.Show("Only local paths allowed:\n\n" + sPath, "Error");
                this.Close();
            }
            else
            {
                EnableControls(false);
                m_ctrlTreeView.DataContext = null;

                m_wcRoot = WorkingCopy.GetExternals(this, out sStdErr, m_ViewRoot, System.IO.Path.GetFullPath(sPath), null);

                /*if (null != m_wcRoot)
                 * {
                 *  m_ViewRoot = new TreeItem (m_wcRoot);
                 *  m_ViewContext = new TreeItem (new WorkingCopy ());
                 *  m_ViewContext.m_Childs.Add (m_ViewRoot);
                 *
                 *  m_ctrlTreeView.DataContext = null;      // required for final update of layout
                 *  m_ctrlTreeView.DataContext = m_ViewContext;
                 * }*/

                EnableControls(true);
                m_ctrlTreeView.Focus();

                if (null == m_wcRoot)
                {
                    MessageBox.Show("No externals or no working copy found:\n\n" + sStdErr, "Error");
                    this.Close();
                }
            }
        }