public override void RenameItem(string newName)
        {
            IProfilingSnapshot snapshot = (IProfilingSnapshot)CurrentNode.DataItem;

            if (FileService.IsValidFileName(newName))
            {
                snapshot.Name = newName;
            }
            else
            {
                MessageService.ShowError(GettextCatalog.GetString("Invalid filename"));
            }
        }
Exemplo n.º 2
0
        public static void RemoveSnapshot(IProfilingSnapshot snapshot)
        {
            AlertButton removeFromProject = new AlertButton(GettextCatalog.GetString("_Remove from Project"), Gtk.Stock.Remove);
            AlertButton result            = MessageService.AskQuestion(GettextCatalog.GetString("Are you sure you want to remove snapshot '{0}'?", snapshot.Name),
                                                                       GettextCatalog.GetString("Delete physically removes the file from disc."),
                                                                       AlertButton.Delete, AlertButton.Cancel, removeFromProject);

            if (result != AlertButton.Cancel)
            {
                ProfilingService.ProfilingSnapshots.Remove(snapshot);
                if (result == AlertButton.Delete && File.Exists(snapshot.FileName))
                {
                    FileService.DeleteFile(snapshot.FileName);
                }
            }
        }
Exemplo n.º 3
0
        public static IProfilingSnapshot LoadSnapshot(string filename)
        {
            if (filename == null)
            {
                throw new ArgumentNullException("filename");
            }

            foreach (IProfiler prof in profilers.Values)
            {
                if (prof.CanLoad(filename))
                {
                    IProfilingSnapshot snapshot = prof.Load(filename);
                    if (snapshot != null)
                    {
                        profilingSnapshots.Add(snapshot);
                        return(snapshot);
                    }
                }
            }

            MessageService.ShowError(GettextCatalog.GetString("Unable to load profiling snapshot '{0}'."), filename);
            return(null);
        }
Exemplo n.º 4
0
        public static void LoadSnapshot(string profilerIdentifier, string filename)
        {
            if (filename == null)
            {
                throw new ArgumentNullException("filename");
            }
            if (profilerIdentifier == null)
            {
                throw new ArgumentNullException("profilerIdentifier");
            }

            IProfiler prof = GetProfiler(profilerIdentifier);

            if (prof != null)
            {
                IProfilingSnapshot snapshot = prof.Load(filename);
                if (snapshot != null)
                {
                    profilingSnapshots.Add(snapshot);
                    return;
                }
            }
            MessageService.ShowError(GettextCatalog.GetString("Unable to load profiling snapshot '{0}'."), filename);
        }
		public ProfilingSnapshotEventArgs (IProfilingSnapshot snapshot)
		{
			this.snapshot = snapshot;
		}
 public ProfilingSnapshotEventArgs(IProfilingSnapshot snapshot)
 {
     this.snapshot = snapshot;
 }
        public override void DeleteItem()
        {
            IProfilingSnapshot snapshot = (IProfilingSnapshot)CurrentNode.DataItem;

            ProfilingService.RemoveSnapshot(snapshot);
        }
Exemplo n.º 8
0
		public static void RemoveSnapshot (IProfilingSnapshot snapshot)
		{
			AlertButton removeFromProject = new AlertButton (GettextCatalog.GetString ("_Remove from Project"), Gtk.Stock.Remove);
			AlertButton result = MessageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to remove snapshot '{0}'?", snapshot.Name),
			                                                 GettextCatalog.GetString ("Delete physically removes the file from disc."), 
			                                                 AlertButton.Delete, AlertButton.Cancel, removeFromProject);
			
			if (result != AlertButton.Cancel) {
				ProfilingService.ProfilingSnapshots.Remove (snapshot);
				if (result == AlertButton.Delete && File.Exists (snapshot.FileName))
					FileService.DeleteFile (snapshot.FileName);
			}		
		}