~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/core/MonoDevelop.Core/MonoDevelop.Core.Serialization/SerializationContext.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
using System;
30
30
using MonoDevelop.Core;
 
31
using System.Collections.Generic;
31
32
 
32
33
namespace MonoDevelop.Core.Serialization
33
34
{
38
39
                DataSerializer serializer;
39
40
                IProgressMonitor monitor;
40
41
                char directorySeparatorChar = System.IO.Path.DirectorySeparatorChar;
 
42
                HashSet<ItemProperty> forcedSerializationProps;
41
43
                
42
44
                public string BaseFile {
43
45
                        get { return file; }
80
82
                        }
81
83
                }
82
84
                
83
 
                internal bool IncludeDefaultValues { get; set; }
 
85
                public bool IncludeDefaultValues { get; set; }
 
86
                
 
87
                public void ResetDefaultValueSerialization ()
 
88
                {
 
89
                        forcedSerializationProps = null;
 
90
                }
 
91
                
 
92
                public void ForceDefaultValueSerialization (ItemProperty prop)
 
93
                {
 
94
                        if (forcedSerializationProps == null)
 
95
                                forcedSerializationProps = new HashSet<ItemProperty> ();
 
96
                        forcedSerializationProps.Add (prop);
 
97
                }
 
98
                
 
99
                public bool IsDefaultValueSerializationForced (ItemProperty prop)
 
100
                {
 
101
                        if (IncludeDefaultValues)
 
102
                                return true;
 
103
                        else if (forcedSerializationProps != null)
 
104
                                return forcedSerializationProps.Contains (prop);
 
105
                        else
 
106
                                return false;
 
107
                }
84
108
                
85
109
                public virtual void Close ()
86
110
                {