Esempio n. 1
0
        private bool DoHistory(IEnumerable <IResource> resources)
        {
            if (!CanUseSourceControl)
            {
                return(false);
            }

            var tables = new DataTable[resources.Count()];

            for (var i = 0; i < tables.Length; i++)
            {
                tables[i] = SourceControlService.GetRevisionLog(resources.ElementAt(i).Uri);
            }

            for (var i = 0; i < tables.Length; i++)
            {
                using (var dialog = new SledSourceControlHistoryForm())
                {
                    dialog.Uri = resources.ElementAt(i).Uri;

                    foreach (DataRow row in tables[i].Rows)
                    {
                        // How row is created in P4 plugin

                        /*
                         * DataRow row = p4DataTable.NewRow();
                         * row["revision"] = Int32.Parse(change);
                         * row["user"] = user;
                         * row["description"] = desc;
                         * row["status"] = status;
                         * row["client"] = client;
                         * row["time"] = date;
                         */

                        // NOTE: These might not match what SVN uses for its row keys (!)

                        dialog.AddEntry(
                            new SledSourceControlHistoryForm.Entry
                        {
                            Revision    = (int)row["revision"],
                            User        = (string)row["user"],
                            Description = (string)row["description"],
                            Status      = (string)row["status"],
                            Client      = (string)row["client"],
                            Date        = (DateTime)row["time"]
                        });
                    }

                    dialog.ShowDialog(m_mainForm);
                }
            }

            return(true);
        }
Esempio n. 2
0
        private bool DoHistory(IEnumerable<IResource> resources)
        {
            if (!CanUseSourceControl)
                return false;

            var tables = new DataTable[resources.Count()];
            for (var i = 0; i < tables.Length; i++)
                tables[i] = SourceControlService.GetRevisionLog(resources.ElementAt(i).Uri);

            for (var i = 0; i < tables.Length; i++)
            {
                using (var dialog = new SledSourceControlHistoryForm())
                {
                    dialog.Uri = resources.ElementAt(i).Uri;

                    foreach (DataRow row in tables[i].Rows)
                    {
                        // How row is created in P4 plugin
                        /*
                         * DataRow row = p4DataTable.NewRow();
                         * row["revision"] = Int32.Parse(change);
                         * row["user"] = user;
                         * row["description"] = desc;
                         * row["status"] = status;
                         * row["client"] = client;
                         * row["time"] = date;
                         */

                        // NOTE: These might not match what SVN uses for its row keys (!)

                        dialog.AddEntry(
                            new SledSourceControlHistoryForm.Entry
                                {
                                    Revision = (int)row["revision"],
                                    User = (string)row["user"],
                                    Description = (string)row["description"],
                                    Status = (string)row["status"],
                                    Client = (string)row["client"],
                                    Date = (DateTime)row["time"]
                                });
                    }

                    dialog.ShowDialog(m_mainForm);
                }
            }

            return true;
        }