Наследование: System.Windows.Forms.UserControl
Пример #1
0
        protected HeapRecording(
            TaskScheduler scheduler,
            ActivityIndicator activities,
            ProcessStartInfo startInfo
        )
        {
            StartInfo = startInfo;
            Activities = activities;

            Scheduler = scheduler;

            Futures.Add(Scheduler.Start(
                ProfileMainTask(), TaskExecutionPolicy.RunAsBackgroundTask
            ));

            DiffCache.ItemEvicted += DiffCache_ItemEvicted;
        }
Пример #2
0
        protected HeapRecording(
            TaskScheduler scheduler,
            ActivityIndicator activities,
            IEnumerable<string> snapshots
        )
        {
            Scheduler = scheduler;
            Activities = activities;

            Futures.Add(Scheduler.Start(
                LoadExistingMainTask(), TaskExecutionPolicy.RunAsBackgroundTask
            ));

            SnapshotLoadQueue.EnqueueMultiple(snapshots);

            DiffCache.ItemEvicted += DiffCache_ItemEvicted;
        }
Пример #3
0
        public static HeapRecording StartProcess(
            TaskScheduler scheduler, ActivityIndicator activities, string executablePath, string arguments, string workingDirectory
        )
        {
            var psi = new ProcessStartInfo(
                executablePath, arguments
            );
            psi.UseShellExecute = false;

            if ((workingDirectory != null) && (workingDirectory.Trim().Length > 0))
                psi.WorkingDirectory = workingDirectory;
            else
                psi.WorkingDirectory = Path.GetDirectoryName(executablePath);

            return new HeapRecording(scheduler, activities, psi);
        }
Пример #4
0
 public static HeapRecording FromRecording(TaskScheduler scheduler, ActivityIndicator activities, string recordingFilename)
 {
     return new HeapRecording(
         scheduler, activities, recordingFilename
     );
 }
Пример #5
0
 public static HeapRecording FromSnapshots(TaskScheduler scheduler, ActivityIndicator activities, IEnumerable<string> snapshots)
 {
     return new HeapRecording(
         scheduler, activities, snapshots
     );
 }
Пример #6
0
        public IEnumerator<object> Move(string targetFilename, ActivityIndicator activities)
        {
            // Wait for any pending operations running against the tangles
            var cb = new BarrierCollection(true, Tangles);
            using (activities.AddItem("Waiting for database to be idle"))
                yield return cb;

            foreach (var tangle in Tangles)
                tangle.Dispose();

            Tangles.Clear();

            var f = Future.RunInThread(() => {
                File.Delete(_TokenFilePath);

                if (File.Exists(targetFilename))
                    File.Delete(targetFilename);

                Storage.Folder = targetFilename;

                MakeTokenFile(targetFilename);

                _Filename = targetFilename;
            });

            using (activities.AddItem("Moving database"))
                yield return f;

            var failed = f.Failed;

            yield return CreateTangles();

            if (failed)
                throw f.Error;
        }
Пример #7
0
        protected HeapRecording(
            TaskScheduler scheduler,
            ActivityIndicator activities,
            string filename
        )
        {
            Scheduler = scheduler;
            Activities = activities;

            DiffCache.ItemEvicted += DiffCache_ItemEvicted;

            if (filename.EndsWith(".heaprecording") || File.Exists(filename))
                filename = Path.GetDirectoryName(filename);

            if (!Directory.Exists(filename))
                throw new Exception(String.Format("Recording not found: {0}", filename));

            _Database = new DatabaseFile(Scheduler, filename); Futures.Add(Scheduler.Start(
                LoadRecordingMainTask(filename),
                TaskExecutionPolicy.RunAsBackgroundTask
            ));
        }
Пример #8
0
 public CountedItem(ActivityIndicator parent, string description)
 {
     Parent      = parent;
     Description = description;
 }
Пример #9
0
 public static HeapRecording FromRecording(TaskScheduler scheduler, ActivityIndicator activities, string recordingFilename)
 {
     return(new HeapRecording(
                scheduler, activities, recordingFilename
                ));
 }
Пример #10
0
 public static HeapRecording FromSnapshots(TaskScheduler scheduler, ActivityIndicator activities, IEnumerable <string> snapshots)
 {
     return(new HeapRecording(
                scheduler, activities, snapshots
                ));
 }
Пример #11
0
 internal Item(ActivityIndicator owner)
 {
     Owner = owner;
     Label = new Label {
         AutoSize = false,
         TextAlign = ContentAlignment.MiddleLeft,
         Visible = false
     };
     ProgressBar = new ProgressBar {
         Style = ProgressBarStyle.Marquee,
         MarqueeAnimationSpeed = 50,
         Visible = false
     };
 }
Пример #12
0
 public CountedItem(ActivityIndicator parent, string description)
 {
     Parent = parent;
     Description = description;
 }