Beispiel #1
0
        public static void Process(
            Sql.ObjectTag tag
            )
        {
            Debug.Assert(tag != null);

            // Validate input.
            if (tag == null)
            {
                return;
            }

            // Retrieve snapshot & its filters.
            Sql.Snapshot snapshot = null;
            List <Sql.DataCollectionFilter> filters = null;

            snapshot = Sql.Snapshot.GetSnapShot(tag.SnapshotId);
            if (snapshot != null)
            {
                if (string.Compare(snapshot.Status, Utility.Snapshot.StatusInProgress) == 0)
                {
                    Sql.RegisteredServer rServer = Program.gController.Repository.GetServer(snapshot.ConnectionName);
                    if (rServer != null)
                    {
                        rServer.ShowDataCollectionProgress();
                    }
                }
                else
                {
                    filters = Sql.DataCollectionFilter.GetSnapshotFilters(snapshot.ConnectionName, tag.SnapshotId);

                    // If snapshot retrieved, then display the form.
                    if (snapshot != null && filters != null)
                    {
                        Form_SnapshotProperties form = new Form_SnapshotProperties(snapshot, filters);
                        form.ShowDialog();
                    }
                }
            }
        }