dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel/Design/Seriali


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel/Design/Serialization ContextStack.cs,NONE,1.1 DesignerLoader.cs,NONE,1.1 DesignerSerializerAttribute.cs,NONE,1.1 IDesignerLoaderHost.cs,NONE,1.1 IDesignerLoaderService.cs,NONE,1.1 IDesignerSerializationManager.cs,NONE,1.1 IDesignerSerializationProvider.cs,NONE,1.1 IDesignerSerializationService.cs,NONE,1.1 INameCreationService.cs,NONE,1.1 InstanceDescriptor.cs,NONE,1.1 Makefile,NONE,1.1 ResolveNameEventArgs.cs,NONE,1.1 ResolveNameEventHandler.cs,NONE,1.1 RootDesignerSerializerAttribute.cs,NONE,1.1
Date: Fri, 23 May 2003 20:42:37 -0400

Update of 
/cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/Design/Serialization
In directory 
subversions:/tmp/cvs-serv8616/System/ComponentModel/Design/Serialization

Added Files:
        ContextStack.cs DesignerLoader.cs 
        DesignerSerializerAttribute.cs IDesignerLoaderHost.cs 
        IDesignerLoaderService.cs IDesignerSerializationManager.cs 
        IDesignerSerializationProvider.cs 
        IDesignerSerializationService.cs INameCreationService.cs 
        InstanceDescriptor.cs Makefile ResolveNameEventArgs.cs 
        ResolveNameEventHandler.cs RootDesignerSerializerAttribute.cs 
Log Message:


Implement missing classes in the "System.ComponentModel.Design" namespace.


--- NEW FILE ---
/*
 * ContextStack.cs - Implementation of the
 *              "System.ComponentModel.Design.Serialization.ContextStack" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

public sealed class ContextStack
{
        // Internal state.
        private Object[] stack;
        private int size;

        // Constructor.
        public ContextStack()
                        {
                                stack = null;
                                size = 0;
                        }

        // Get the current object on the context stack.
        public Object Current
                        {
                                get
                                {
                                        if(size > 0)
                                        {
                                                return stack[size - 1];
                                        }
                                        else
                                        {
                                                return null;
                                        }
                                }
                        }

        // Get the first object on the context stack of a particular type.
        public Object this[Type type]
                        {
                                get
                                {
                                        int posn = size - 1;
                                        while(posn >= 0)
                                        {
                                                
if(type.IsAssignableFrom(stack[posn].GetType()))
                                                {
                                                        return stack[posn];
                                                }
                                                --posn;
                                        }
                                        return null;
                                }
                        }

        // Get the object "level" items down the context stack.
        public Object this[int level]
                        {
                                get
                                {
                                        if(level < size)
                                        {
                                                return stack[size - 1 - level];
                                        }
                                        else
                                        {
                                                return null;
                                        }
                                }
                        }

        // Pop the top-most item from the context stack.
        public Object Pop()
                        {
                                if(size > 0)
                                {
                                        --size;
                                        return stack[size];
                                }
                                else
                                {
                                        return null;
                                }
                        }

        // Push a new object onto the context stack.
        public void Push(Object context)
                        {
                                if(context == null)
                                {
                                        throw new 
ArgumentNullException("context");
                                }
                                if(stack == null)
                                {
                                        stack = new Object [16];
                                }
                                else if(size >= stack.Length)
                                {
                                        Object[] newStack = new Object [size * 
2];
                                        Array.Copy(stack, 0, newStack, 0, size);
                                        stack = newStack;
                                }
                                stack[size++] = context;
                        }

}; // class ContextStack

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * DesignerLoader.cs - Implementation of the
 *              "System.ComponentModel.Design.Serialization.DesignerLoader" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

public abstract class DesignerLoader
{
        // Constructor.
        protected DesignerLoader() {}

        // Determine if we are currently loading.
        public virtual bool Loading
                        {
                                get
                                {
                                        // Nothing to do here in the base class.
                                        return false;
                                }
                        }

        // Begin loading a designer.
        public abstract void BeginLoad(IDesignerLoaderHost host);

        // Dispose of the loader.
        public abstract void Dispose();

        // Flush any changes that were made.
        public virtual void Flush()
                        {
                                // Nothing to do here in the base class.
                        }

}; // class DesignerLoader

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * DesignerSerializerAttribute.cs - Implementation of
 *      
"System.ComponentModel.Design.Serialization.DesignerSerializerAttribute".
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
public sealed class DesignerSerializerAttribute : Attribute
{
        // Internal state.
        private String serializerTypeName;
        private String baseSerializerTypeName;

        // Constructors.
        public DesignerSerializerAttribute
                                (String serializerTypeName, String 
baseSerializerTypeName)
                        {
                                this.serializerTypeName = serializerTypeName;
                                this.baseSerializerTypeName = 
baseSerializerTypeName;
                        }
        public DesignerSerializerAttribute
                                (String serializerTypeName, Type 
baseSerializerType)
                        {
                                this.serializerTypeName = serializerTypeName;
                                this.baseSerializerTypeName =
                                        
baseSerializerType.AssemblyQualifiedName;
                        }
        public DesignerSerializerAttribute
                                (Type serializerType, Type baseSerializerType)
                        {
                                this.serializerTypeName =
                                        serializerType.AssemblyQualifiedName;
                                this.baseSerializerTypeName =
                                        
baseSerializerType.AssemblyQualifiedName;
                        }

        // Get this attribute's properties.
        public String SerializerBaseTypeName
                        {
                                get
                                {
                                        return baseSerializerTypeName;
                                }
                        }
        public String SerializerTypeName
                        {
                                get
                                {
                                        return serializerTypeName;
                                }
                        }
        public override Object TypeId
                        {
                                get
                                {
                                        return base.TypeId;
                                }
                        }

}; // class DesignerSerializerAttribute

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * IDesignerLoaderHost.cs - Implementation of the
 *              
"System.ComponentModel.Design.Serialization.IDesignerLoaderHost" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

using System.Collections;

public interface IDesignerLoaderHost
        : IDesignerHost, IServiceContainer, IServiceProvider
{
        // End the loading operation.
        void EndLoad(String baseClassName, bool successful,
                                 ICollection errorCollection);

        // Reload the document.
        void Reload();

}; // interface IDesignerLoaderHost

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * IDesignerLoaderService.cs - Implementation of the
 *      "System.ComponentModel.Design.Serialization.IDesignerLoaderService" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

using System.Collections;

public interface IDesignerLoaderService
{
        // Add a load dependency.
        void AddLoadDependency();

        // Signal that a dependent load has completed.
        void DependentLoadComplete(bool successful, ICollection 
errorCollection);

        // Reload the design document.
        void Reload();

}; // interface IDesignerLoaderService

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * IDesignerSerializationManager.cs - Implementation of
 *      
"System.ComponentModel.Design.Serialization.IDesignerSerializationManager".
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

using System.Collections;

public interface IDesignerSerializationManager : IServiceProvider
{
        // Get the context stack.
        ContextStack Context { get; }

        // Get the custom properties collection.
        PropertyDescriptorCollection Properties { get; }

        // Add a serialization provider to this manager.
        void AddSerializationProvider(IDesignerSerializationProvider provider);

        // Create an instance of a particular type.
        Object CreateInstance(Type type, ICollection arguments,
                                          String name, bool addToContainer);

        // Get an object instance with a specified name.
        Object GetInstance(String name);

        // Get the name associated with a specified object.
        String GetName(Object value);

        // Get a serializer of a specific type.
        Object GetSerializer(Type objectType, Type serializerType);

        // Get a type with a specific name.
        Type GetType(String typeName);

        // Remove a serialization provider from this manager.
        void RemoveSerializationProvider(IDesignerSerializationProvider 
provider);

        // Report a serialization error.
        void ReportError(Object errorInformation);

        // Set the name of an existing object.
        void SetName(Object instance, String name);

        // Event that is emitted when a name is resolved.
        event ResolveNameEventHandler ResolveName;

        // Event that is emitted when serialization has completed.
        event EventHandler SerializationComplete;

}; // interface IDesignerSerializationManager

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * IDesignerSerializationProvider.cs - Implementation of
 *      
"System.ComponentModel.Design.Serialization.IDesignerSerializationProvider".
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

public interface IDesignerSerializationProvider
{
        // Get a serializer with the specified attributes.
        Object GetSerializer(IDesignerSerializationManager manager,
                                         Object currentSerializer,
                                         Type objectType, Type serializerType);

}; // interface IDesignerSerializationProvider

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * IDesignerSerializationService.cs - Implementation of
 *      
"System.ComponentModel.Design.Serialization.IDesignerSerializationService".
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

using System.Collections;

public interface IDesignerSerializationService
{
        // Deserialize a data value into a collection of objects.
        ICollection Deserialize(Object serializationData);

        // Serialize a collection of objects.
        Object Serialize(ICollection objects);

}; // interface IDesignerSerializationService

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * INameCreationService.cs - Implementation of the
 *              
"System.ComponentModel.Design.Serialization.INameCreationService" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

public interface INameCreationService
{
        // Create a new name that is unique to all components in its container.
        String CreateName(IContainer container, Type dataType);

        // Determine if a name is valid.
        bool IsValidName(String name);

        // Validate a name.
        void ValidateName(String name);

}; // interface INameCreationService

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * InstanceDescriptor.cs - Implementation of the
 *              "System.ComponentModel.Design.Serialization.InstanceDescriptor" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

using System.Collections;
using System.Reflection;

public sealed class InstanceDescriptor
{
        // Internal state.
        private MemberInfo member;
        private ICollection arguments;
        private bool isComplete;

        // Constructors.
        public InstanceDescriptor(MemberInfo member, ICollection arguments)
                        {
                                this.member = member;
                                this.arguments = arguments;
                                this.isComplete = true;
                        }
        public InstanceDescriptor
                                (MemberInfo member, ICollection arguments, bool 
isComplete)
                        {
                                this.member = member;
                                this.arguments = arguments;
                                this.isComplete = isComplete;
                        }

        // Get this object's properties.
        public ICollection Arguments
                        {
                                get
                                {
                                        return arguments;
                                }
                        }
        public bool IsComplete
                        {
                                get
                                {
                                        return isComplete;
                                }
                        }
        public MemberInfo MemberInfo
                        {
                                get
                                {
                                        return member;
                                }
                        }

        // Invoke this instance descriptor.
        public Object Invoke()
                        {
                                int posn;

                                // Convert the arguments.
                                Object[] args = new Object [Arguments.Count];
                                Arguments.CopyTo(args, 0);
                                for(posn = 0; posn < args.Length; ++posn)
                                {
                                        if(args[posn] is InstanceDescriptor)
                                        {
                                                args[posn] =
                                                        
((InstanceDescriptor)(args[posn])).Invoke();
                                        }
                                }

                                // Determine how to invoke the member.
                                Object result = null;
                                switch(member.MemberType)
                                {
                                        case MemberTypes.Constructor:
                                        {
                                                result = 
((ConstructorInfo)member).Invoke(args);
                                        }
                                        break;

                                        case MemberTypes.Method:
                                        {
                                                result = 
((MethodInfo)member).Invoke(null, args);
                                        }
                                        break;

                                        case MemberTypes.Property:
                                        {
                                                result = 
((PropertyInfo)member).GetValue(null, args);
                                        }
                                        break;

                                        case MemberTypes.Field:
                                        {
                                                result = 
((FieldInfo)member).GetValue(null);
                                        }
                                        break;
                                }
                                return result;
                        }

}; // class InstanceDescriptor

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---

all:
        (cd ../../..;make)
        (cd ../../..;make phase-two)

--- NEW FILE ---
/*
 * ResolveNameEventArgs.cs - Implementation of the
 *              
"System.ComponentModel.Design.Serialization.ResolveNameEventArgs" class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

public class ResolveNameEventArgs : EventArgs
{
        // Internal state.
        private String name;
        private Object value;

        // Constructor.
        public ResolveNameEventArgs(String name)
                        {
                                this.name = name;
                        }

        // Get or set this object's properties.
        public String Name
                        {
                                get
                                {
                                        return name;
                                }
                        }
        public Object Value
                        {
                                get
                                {
                                        return value;
                                }
                                set
                                {
                                        this.value = value;
                                }
                        }

}; // class ResolveNameEventArgs

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * ResolveNameEventHandler.cs - Implementation of the
 *      "System.ComponentModel.Design.Serialization.ResolveNameEventHandler" 
class.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

[Serializable]
public delegate void ResolveNameEventHandler
                        (Object sender, ResolveNameEventArgs e);

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization

--- NEW FILE ---
/*
 * RootDesignerSerializerAttribute.cs - Implementation of
 * "System.ComponentModel.Design.Serialization.RootDesignerSerializerAttribute"
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

namespace System.ComponentModel.Design.Serialization
{

#if !ECMA_COMPAT

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
public sealed class RootDesignerSerializerAttribute : Attribute
{
        // Internal state.
        private String serializerTypeName;
        private String baseSerializerTypeName;
        private bool reloadable;

        // Constructors.
        public RootDesignerSerializerAttribute
                                (String serializerTypeName, String 
baseSerializerTypeName,
                                 bool reloadable)
                        {
                                this.serializerTypeName = serializerTypeName;
                                this.baseSerializerTypeName = 
baseSerializerTypeName;
                                this.reloadable = reloadable;
                        }
        public RootDesignerSerializerAttribute
                                (String serializerTypeName, Type 
baseSerializerType,
                                 bool reloadable)
                        {
                                this.serializerTypeName = serializerTypeName;
                                this.baseSerializerTypeName =
                                        
baseSerializerType.AssemblyQualifiedName;
                                this.reloadable = reloadable;
                        }
        public RootDesignerSerializerAttribute
                                (Type serializerType, Type baseSerializerType,
                                 bool reloadable)
                        {
                                this.serializerTypeName =
                                        serializerType.AssemblyQualifiedName;
                                this.baseSerializerTypeName =
                                        
baseSerializerType.AssemblyQualifiedName;
                                this.reloadable = reloadable;
                        }

        // Get this attribute's properties.
        public bool Reloadable
                        {
                                get
                                {
                                        return reloadable;
                                }
                        }
        public String SerializerBaseTypeName
                        {
                                get
                                {
                                        return baseSerializerTypeName;
                                }
                        }
        public String SerializerTypeName
                        {
                                get
                                {
                                        return serializerTypeName;
                                }
                        }
        public override Object TypeId
                        {
                                get
                                {
                                        return base.TypeId;
                                }
                        }

}; // class RootDesignerSerializerAttribute

#endif // !ECMA_COMPAT

}; // namespace System.ComponentModel.Design.Serialization





reply via email to

[Prev in Thread] Current Thread [Next in Thread]