diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-09 13:50:40 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-09 13:50:40 +0200 |
| commit | 0c200d4ae4f0f4a7a7c58c3affc7670eb6b2dcff (patch) | |
| tree | a0650162842e5e9089d146ab20d555865b6a3011 /src/Interface.cs | |
| parent | ea0ee8408e82a19c00637aaa054165bbb49805ba (diff) | |
simplify Loading, removed unnecessary overloads
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 63160cf5..2fea548a 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -87,6 +87,7 @@ namespace go } return stream; } + public static GraphicObject Load(string path, object hostClass = null) { string root = "Object"; @@ -112,42 +113,7 @@ namespace go stream.Dispose (); return tmp; } - public static void Load<T>(string file, out T result, object hostClass = null) - { - GOMLResolutionStack.Push(new List<DynAttribute>()); - - XmlSerializerNamespaces xn = new XmlSerializerNamespaces(); - xn.Add("", ""); - XmlSerializer xs = new XmlSerializer(typeof(T)); - - using (Stream s = new FileStream(file, FileMode.Open)) - { - result = (T)xs.Deserialize(s); - } - - if (hostClass == null) - return; - - resolveGOML (hostClass); - -// while (Bindings.Count > 0) { -// DynAttribute binding = Bindings [0]; -// Bindings.RemoveAt (0); -// CompilerServices.ResolveBinding (binding, hostClass); -// } -// foreach (DynAttribute binding in Bindings) { -//// Type tSource = binding.Source.GetType (); -//// if (!tSource.GetInterfaces ().Any (i => i.Name == "IValueChange")){ -//// Debug.WriteLine ("Binding source does not implement IValueChange."); -//// continue; -//// } -// //MemberInfo mi = binding.Source.GetType ().GetMember (binding.MemberName); -// CompilerServices.CreateBinding (binding, hostClass); -// } -// Bindings.Clear (); - } - - public static GraphicObject Load(Stream stream, Type type, object hostClass = null) + static GraphicObject Load(Stream stream, Type type, object hostClass = null) { GraphicObject result; GOMLResolutionStack.Push(new List<DynAttribute>()); |