~ubuntu-branches/ubuntu/precise/gnome-do/precise-proposed

« back to all changes in this revision

Viewing changes to Do/src/Do.Core/DoItemSource.cs

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-09-14 10:09:40 UTC
  • mto: (0.1.8 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20080914100940-kyghudg7py14bu2z
Tags: upstream-0.6.0.0
ImportĀ upstreamĀ versionĀ 0.6.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
                                } catch (Exception e) {
45
45
                                        LogError ("SupportedItemTypes", e);
46
46
                                } finally {
47
 
                                        types = types ?? new Type [0];
 
47
                                        types = types ?? Type.EmptyTypes;
48
48
                                }
49
49
                                return types;
50
50
                        }
62
62
                public ICollection<IItem> Items
63
63
                {
64
64
                        get {
 
65
                                List<IItem> items;
 
66
                                ICollection<IItem> innerItems = null;
65
67
                                IItemSource source = Inner as IItemSource;
66
 
                                ICollection<IItem> innerItems = null;
67
 
                                List<IItem> items;
68
68
                                
69
69
                                items = new List<IItem> ();
70
70
                                try {
71
71
                                        innerItems = source.Items;
 
72
                                        // Copy the collection:
 
73
                                        if (null != innerItems)
 
74
                                                innerItems = new List<IItem> (innerItems);
72
75
                                } catch (Exception e) {
73
76
                                        LogError ("Items", e);
74
77
                                } finally {
87
90
                
88
91
                public ICollection<IItem> ChildrenOfItem (IItem item)
89
92
                {
 
93
                        List<IItem> doChildren;
 
94
                        ICollection<IItem> children = null;
90
95
                        IItemSource source = Inner as IItemSource;
91
 
                        ICollection<IItem> children = null;
92
 
                        List<IItem> doChildren;
93
96
                        
94
97
                        doChildren = new List<IItem> ();
95
98
                        item = EnsureIItem (item);
99
102
 
100
103
                        try {
101
104
                                children = source.ChildrenOfItem (item);
 
105
                                // Copy the collection:
 
106
                                if (null != children)
 
107
                                        children = new List<IItem> (children);
102
108
                        } catch (Exception e) {
103
109
                                LogError ("ChildrenOfItem", e);
104
110
                        } finally {