Added some files to System.ComponentModel.Design.Serialization
authorAlejandro Sánchez Acosta <asanchez@mono-cvs.ximian.com>
Thu, 5 Dec 2002 01:22:00 +0000 (01:22 -0000)
committerAlejandro Sánchez Acosta <asanchez@mono-cvs.ximian.com>
Thu, 5 Dec 2002 01:22:00 +0000 (01:22 -0000)
svn path=/trunk/mcs/; revision=9388

13 files changed:
mcs/class/System.Design/System.ComponentModel.Design.Serialization/Changelog [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/CodeDomSerializer.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/ContextStack.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerLoaderService.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationService.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/INameCreationService.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/ResolveNameEventArgs.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs [new file with mode: 0644]
mcs/class/System.Design/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.cs [new file with mode: 0644]

diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/Changelog b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/Changelog
new file mode 100644 (file)
index 0000000..aa5e98f
--- /dev/null
@@ -0,0 +1,16 @@
+2002-12-05  Alejandro Sánchez Acosta  <raciel@gnome.org>
+
+       * CodeDomSerializer.cs,
+         IDesignerLoaderService.cs,
+         INameCreationService.cs,
+         ContextStack.cs,   
+         IDesignerSerializationManager.cs,
+         ResolveNameEventArgs.cs,
+         ICodeDomDesignerReload.cs, 
+         IDesignerSerializationProvider.cs,
+         ResolveNameEventHandler.cs,
+         IDesignerLoaderHost.cs, 
+         IDesignerSerializationService.cs,
+         RootDesignerSerializerAttribute.cs: Added
+
+       
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/CodeDomSerializer.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/CodeDomSerializer.cs
new file mode 100644 (file)
index 0000000..e54dd35
--- /dev/null
@@ -0,0 +1,85 @@
+// System.ComponentModel.Design.Serialization.CodeDomSerializer.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.CodeDom;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public abstract class CodeDomSerializer
+       {
+               [MonoTODO]
+               protected CodeDomSerializer() {
+                       throw new NotImplementedException ();
+               }
+
+               public abstract object Deserialize (IDesignerSerializationManager manager, object codeObject);
+
+               [MonoTODO]
+               protected void DeserializePropertiesFromResources (IDesignerSerializationManager manager, object value, Attribute[] filter) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected object DeserializeExpression (IDesignerSerializationManager manager, string name, CodeExpression expression) 
+               {
+                       throw new NotImplementedException (); 
+               }
+
+               [MonoTODO]              
+               protected void DeserializeStatement (IDesignerSerializationManager manager, CodeStatement statement) 
+               {       
+                       throw new NotImplementedException ();
+               }
+
+               public abstract object Serialize (IDesignerSerializationManager manager, object value);
+
+               [MonoTODO]
+               protected void SerializeEvents (IDesignerSerializationManager manager, CodeStatementCollection statements, object value, Attribute[] filter) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected void SerializeProperties (IDesignerSerializationManager manager, CodeStatementCollection statements, object value, Attribute[] filter) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected void SerializePropertiesToResources (IDesignerSerializationManager manager, CodeStatementCollection statements, object value, Attribute[] filter) 
+               {
+                       throw new NotImplementedException ();
+               }
+                        
+
+               [MonoTODO]
+               protected void SerializeResource (IDesignerSerializationManager manager, string resourceName, object value) 
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected void SerializeResourceInvariant (IDesignerSerializationManager manager, string resourceName, object value) 
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               [MonoTODO]
+               protected CodeExpression SerializeToExpression (IDesignerSerializationManager manager, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected CodeExpression SerializeToReferenceExpression (IDesignerSerializationManager manager, object value)
+               {
+                       throw new NotImplementedException ();
+               }
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ContextStack.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ContextStack.cs
new file mode 100644 (file)
index 0000000..cba0a2b
--- /dev/null
@@ -0,0 +1,44 @@
+// System.ComponentModel.Design.Serialization.ContextStack.cs
+//
+// Author:
+//      Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.Collections;
+
+namespace System.ComponentModel.Design.Serialization
+{
+        public sealed class ContextStack
+        {
+               public ArrayList list;
+               
+                public ContextStack () {
+                        list = new ArrayList ();
+                }
+
+                public object Current {
+                        get { 
+                                if (list.Count == 0) return null;
+                                return list [list.Count - 1];
+                        }
+
+                       set { 
+                               list.Add (value);
+                        }
+                }
+
+                [MonoTODO]
+               public object this[Type type] {
+                        get { throw new NotImplementedException ();}
+                        set { throw new NotImplementedException ();}
+                }
+
+                [MonoTODO]
+                public object this[int level] {
+                        get { throw new NotImplementedException ();}
+                        set { throw new NotImplementedException ();}
+                }
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ICodeDomDesignerReload.cs
new file mode 100644 (file)
index 0000000..fa9aeb7
--- /dev/null
@@ -0,0 +1,17 @@
+// System.ComponentModel.Design.Serialization.ICodeDomDesignerReload.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.CodeDom;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface ICodeDomDesignerReload
+       {
+               bool ShouldReloadDesigner (CodeCompileUnit newTree);
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerLoaderHost.cs
new file mode 100644 (file)
index 0000000..a32b702
--- /dev/null
@@ -0,0 +1,19 @@
+// System.ComponentModel.Design.Serialization.IDesignerLoaderHost.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.Collections;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface IDesignerLoaderHost : IDesignerHost, IServiceContainer, IServiceProvider
+       {
+               void EndLoad (string baseClassName, bool successful, ICollection errorCollection);
+
+               void Reload();
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerLoaderService.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerLoaderService.cs
new file mode 100644 (file)
index 0000000..7269751
--- /dev/null
@@ -0,0 +1,21 @@
+// System.ComponentModel.Design.Serialization.IDesignerLoaderService.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.Collections;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface IDesignerLoaderService
+       {
+               void AddLoadDependency();
+
+               void DependentLoadComplete (bool successful, ICollection errorCollection);
+
+               bool Reload();
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationManager.cs
new file mode 100644 (file)
index 0000000..718d887
--- /dev/null
@@ -0,0 +1,41 @@
+// System.ComponentModel.Design.Serialization.IDesignerSerializationManager.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.Collections;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface IDesignerSerializationManager : IServiceProvider
+       {
+               ContextStack Context {get;}
+
+               PropertyDescriptorCollection Properties {get;}
+
+               void AddSerializationProvider (IDesignerSerializationProvider provider);
+
+               object CreateInstance (Type type, ICollection arguments, string name, bool addToContainer);
+
+               object GetInstance (string name);
+
+               string GetName (object value);
+
+               object GetSerializer (Type objectType, Type serializerType);
+
+               Type GetType (string typeName);
+
+               void RemoveSerializationProvider (IDesignerSerializationProvider provider);
+
+               void ReportError (object errorInformation);
+
+               void SetName (object instance, string name);
+
+               event ResolveNameEventHandler ResolveName;
+
+               event EventHandler SerializationComplete;
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.cs
new file mode 100644 (file)
index 0000000..8837001
--- /dev/null
@@ -0,0 +1,15 @@
+// System.ComponentModel.Design.Serialization.IDesignerSerializationProvider.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface IDesignerSerializationProvider
+       {
+               object GetSerializer (IDesignerSerializationManager manager, object currentSerializer, Type objectType, Type serializerType);
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationService.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/IDesignerSerializationService.cs
new file mode 100644 (file)
index 0000000..5672195
--- /dev/null
@@ -0,0 +1,19 @@
+// System.ComponentModel.Design.Serialization.IDesignerSerializationService.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.Collections;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface IDesignerSerializationService
+       {
+               ICollection Deserialize (object serializationData);
+
+               object Serialize (ICollection objects);
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/INameCreationService.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/INameCreationService.cs
new file mode 100644 (file)
index 0000000..2b8933d
--- /dev/null
@@ -0,0 +1,21 @@
+// System.ComponentModel.Design.Serialization.INameCreationService.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+using System.Collections;
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public interface INameCreationService
+       {
+               string CreateName (IContainer container, Type dataType);
+
+               bool IsValidName (string name);
+
+               void ValidateName (string name);
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ResolveNameEventArgs.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ResolveNameEventArgs.cs
new file mode 100644 (file)
index 0000000..a229199
--- /dev/null
@@ -0,0 +1,35 @@
+// System.ComponentModel.Design.Serialization.ResolveNameEventArgs.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+namespace System.ComponentModel.Design.Serialization
+{
+       public class ResolveNameEventArgs : EventArgs
+       {
+               public string name;
+       
+               public ResolveNameEventArgs (string name) {
+                       this.name = name;
+               }
+
+               public string Name {
+                       get {
+                               return this.name;
+                       }
+               }
+
+               public object Value {
+                       get {
+                               return this.name;
+                       }
+
+                       set {
+                               name = (string) value;
+                       }
+               }                       
+       }
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs
new file mode 100644 (file)
index 0000000..b9652a4
--- /dev/null
@@ -0,0 +1,13 @@
+// System.ComponentModel.Design.Serialization.ResolvedNameEventHandler.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+namespace System.ComponentModel.Design.Serialization
+{
+       [Serializable]
+       public delegate void ResolveNameEventHandler (object sender, ResolveNameEventArgs e);
+}
diff --git a/mcs/class/System.Design/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.cs b/mcs/class/System.Design/System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.cs
new file mode 100644 (file)
index 0000000..a023c24
--- /dev/null
@@ -0,0 +1,75 @@
+// System.ComponentModel.Design.Serialization.RootDesignerSerializerAttribute.cs
+//
+// Author:
+//     Alejandro Sánchez Acosta   <raciel@gnome.org>
+//
+// (C) Alejandro Sánchez Acosta
+//
+
+namespace System.ComponentModel.Design.Serialization
+{
+       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
+       public sealed class RootDesignerSerializerAttribute : Attribute
+       {
+               private string serializer;
+               private string baseserializer;
+               private Type basetypeserializer;
+               private Type serializertype;
+               private bool reload;
+               
+               public RootDesignerSerializerAttribute (string serializerTypeName, string baseSerializerTypeName, bool reloadable) {
+                       this.serializer = serializerTypeName;
+                       this.baseserializer = baseSerializerTypeName;
+                       this.reload = reloadable;
+               }
+
+               public RootDesignerSerializerAttribute (string serializerTypeName, Type baseSerializerType, bool reloadable) {
+                       this.serializer = serializerTypeName;
+                       this.basetypeserializer = baseSerializerType;
+                       this.reload = reloadable;
+               }
+
+               public RootDesignerSerializerAttribute (Type serializerType, Type baseSerializerType, bool reloadable) {
+                       this.serializertype = serializerType;
+                       this.basetypeserializer = baseSerializerType;
+                       this.reload = reloadable;
+               }
+
+               public bool Reloadable {
+                       get {
+                               return this.reload;
+                       }
+                       
+                       set {
+                               this.reload = value;
+                       }
+               }
+
+               public string SerializerBaseTypeName {
+                       get {
+                               return this.baseserializer;
+                       }
+
+                       set {
+                               this.baseserializer = value;
+                       }
+               }
+
+               public string SerializerTypeName {
+                       get {
+                               return this.serializer;
+                       }
+                       
+                       set {
+                               serializer = value;
+                       }
+               }
+
+               [MonoTODO]
+               public override object TypeId {
+                       get { throw new NotImplementedException ();}
+
+                       set { throw new NotImplementedException ();}
+               }
+       }
+}