~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
using MonoDevelop.Core.StringParsing;
39
39
using MonoDevelop.Core.Instrumentation;
40
40
using MonoDevelop.Projects.Policies;
 
41
using MonoDevelop.Core.Execution;
41
42
 
42
43
namespace MonoDevelop.Projects
43
44
{
178
179
                        }
179
180
                        internal set {
180
181
                                parentSolution = value;
 
182
                                NotifyBoundToSolution (true);
181
183
                        }
182
184
                }
183
185
 
364
366
                        }
365
367
                        internal set {
366
368
                                parentFolder = value;
367
 
                                if (internalChildren != null)
 
369
                                if (internalChildren != null) {
368
370
                                        internalChildren.ParentFolder = value;
369
 
                        }
370
 
                }
 
371
                                }
 
372
                                if (value != null && value.ParentSolution != null) {
 
373
                                        NotifyBoundToSolution (false);
 
374
                                }
 
375
                        }
 
376
                }
 
377
 
 
378
                // Normally, the ParentFolder setter fires OnBoundToSolution. However, when deserializing, child
 
379
                // ParentFolder hierarchies can become connected before the ParentSolution becomes set. This method
 
380
                // enables us to recursively fire the OnBoundToSolution call in those cases.
 
381
                void NotifyBoundToSolution (bool includeInternalChildren)
 
382
                {
 
383
                        var folder = this as SolutionFolder;
 
384
                        if (folder != null) {
 
385
                                var items = folder.GetItemsWithoutCreating ();
 
386
                                if (items != null) {
 
387
                                        foreach (var item in items) {
 
388
                                                item.NotifyBoundToSolution (includeInternalChildren);
 
389
                                        }
 
390
                                }
 
391
                        }
 
392
                        if (includeInternalChildren && internalChildren != null) {
 
393
                                internalChildren.NotifyBoundToSolution (includeInternalChildren);
 
394
                        }
 
395
                        OnBoundToSolution ();
 
396
                }
 
397
 
371
398
 
372
399
                /// <summary>
373
400
                /// Gets a value indicating whether this <see cref="MonoDevelop.Projects.SolutionItem"/> has been disposed.
635
662
                {
636
663
                        return Services.ProjectService.GetExtensionChain (this).CanExecute (this, context, configuration);
637
664
                }
 
665
 
 
666
                /// <summary>
 
667
                /// Gets the execution targets.
 
668
                /// </summary>
 
669
                /// <returns>The execution targets.</returns>
 
670
                /// <param name="configuration">The configuration.</param>
 
671
                public IEnumerable<ExecutionTarget> GetExecutionTargets (ConfigurationSelector configuration)
 
672
                {
 
673
                        return Services.ProjectService.GetExtensionChain (this).GetExecutionTargets (this, configuration);
 
674
                }
 
675
 
 
676
                public event EventHandler ExecutionTargetsChanged;
 
677
 
 
678
                protected virtual void OnExecutionTargetsChanged ()
 
679
                {
 
680
                        if (ExecutionTargetsChanged != null)
 
681
                                ExecutionTargetsChanged (this, EventArgs.Empty);
 
682
                }
638
683
                
639
684
                /// <summary>
640
685
                /// Checks if this solution item has modified files and has to be built
1013
1058
                {
1014
1059
                        return false;
1015
1060
                }
 
1061
 
 
1062
                internal protected virtual IEnumerable<ExecutionTarget> OnGetExecutionTargets (ConfigurationSelector configuration)
 
1063
                {
 
1064
                        yield break;
 
1065
                }
 
1066
 
 
1067
                protected virtual void OnBoundToSolution ()
 
1068
                {
 
1069
                }
1016
1070
                
1017
1071
                /// <summary>
1018
1072
                /// Occurs when the name of the item changes