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

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

[Dotgnu-pnet-commits] pnetlib/runtime/System ApplicationId.cs, NONE, 1.


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/runtime/System ApplicationId.cs, NONE, 1.1 IApplicationDescription.cs, NONE, 1.1 IHostContext.cs, NONE, 1.1 ProvideAssemblyEvidenceEventHandler.cs, NONE, 1.1 StringComparison.cs, NONE, 1.1 __ComObject.cs, NONE, 1.1
Date: Mon, 03 Nov 2003 12:51:48 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System
In directory subversions:/tmp/cvs-serv28468/runtime/System

Added Files:
        ApplicationId.cs IApplicationDescription.cs IHostContext.cs 
        ProvideAssemblyEvidenceEventHandler.cs StringComparison.cs 
        __ComObject.cs 
Log Message:


Add some new .NET Framework 1.2 classes in the "System" namespace.


--- NEW FILE: ApplicationId.cs ---
/*
 * ApplicationId.cs - Implementation of the "System.ApplicationId" 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
{

#if !ECMA_COMPAT

using System.Text;

// Framework 1.2
public sealed class ApplicationId
{
        // Internal state.
        private byte[] publicKeyToken;
        private String strName;
        private Version version;
        private String strProcessorArchitecture;
        private String strCulture;

        // Constructor.
        public ApplicationId(byte[] publicKeyToken, String strName,
                                                 Version version, String 
strProcessorArchitecture,
                                                 String strCulture)
                        {
                                this.publicKeyToken = publicKeyToken;
                                this.strName = strName;
                                this.version = version;
                                this.strProcessorArchitecture = 
strProcessorArchitecture;
                                this.strCulture = strCulture;
                        }

        // Get this object's properties.
        public String Culture
                        {
                                get
                                {
                                        return strCulture;
                                }
                        }
        public String Name
                        {
                                get
                                {
                                        return strName;
                                }
                        }
        public String ProcessorArchitecture
                        {
                                get
                                {
                                        return strProcessorArchitecture;
                                }
                        }
        public byte[] PublicKeyToken
                        {
                                get
                                {
                                        return publicKeyToken;
                                }
                        }
        public Version Version
                        {
                                get
                                {
                                        return version;
                                }
                        }

        // Make a copy of this object.
        public ApplicationId Copy()
                        {
                                return (ApplicationId)(MemberwiseClone());
                        }

        // Determine if two objects are equal.
        public override bool Equals(Object o)
                        {
                                ApplicationId other = (o as ApplicationId);
                                if(other != null)
                                {
                                        if(strName != other.strName ||
                                           strProcessorArchitecture !=
                                                        
other.strProcessorArchitecture ||
                                           strCulture != other.strCulture ||
                                           version != other.version)
                                        {
                                                return false;
                                        }
                                        if(publicKeyToken == null)
                                        {
                                                return (other.publicKeyToken == 
null);
                                        }
                                        else if(other.publicKeyToken == null ||
                                                        publicKeyToken.Length !=
                                                                
other.publicKeyToken.Length)
                                        {
                                                return false;
                                        }
                                        else
                                        {
                                                int posn;
                                                for(posn = 0; posn < 
publicKeyToken.Length; ++posn)
                                                {
                                                        if(publicKeyToken[posn] 
!=
                                                                        
other.publicKeyToken[posn])
                                                        {
                                                                return false;
                                                        }
                                                }
                                                return true;
                                        }
                                }
                                else
                                {
                                        return false;
                                }
                        }

        // Get a hash code for this object.
        public override int GetHashCode()
                        {
                                if(strName != null)
                                {
                                        return strName.GetHashCode();
                                }
                                else
                                {
                                        return 0;
                                }
                        }

        // Convert this object into a string.
        public override String ToString()
                        {
                                StringBuilder builder = new StringBuilder();
                                if(strName != null)
                                {
                                        builder.Append(strName);
                                }
                                if(version != null)
                                {
                                        builder.Append(", Version=");
                                        builder.Append(version.ToString());
                                }
                                if(strProcessorArchitecture != null)
                                {
                                        builder.Append(", 
ProcessorArchitecture=");
                                        
builder.Append(strProcessorArchitecture);
                                }
                                if(strCulture != null)
                                {
                                        builder.Append(", Culture=");
                                        builder.Append(strCulture);
                                }
                                if(publicKeyToken != null)
                                {
                                        builder.Append(", PublicKeyToken=");
                                        foreach(byte value in publicKeyToken)
                                        {
                                                BitConverter.AppendHex(builder, 
value);
                                        }
                                }
                                return builder.ToString();
                        }

}; // class ApplicationId

#endif // !ECMA_COMPAT

}; // namespace System

--- NEW FILE: StringComparison.cs ---
/*
 * StringComparison.cs - Implementation of the "System.StringComparison" 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
{

#if !ECMA_COMPAT

// Framework 1.2
public enum StringComparison
{
        CurrentCulture                          = 0,
        CurrentCultureIgnoreCase        = 1,
        InvariantCulture                        = 2,
        InvariantCultureIgnoreCase      = 3,
        Ordinal                                         = 4,
        OrdinalIgnoreCase                       = 5

}; // enum StringComparison

#endif // !ECMA_COMPAT

}; // namespace System

--- NEW FILE: IApplicationDescription.cs ---
/*
 * IApplicationDescription.cs - Implementation of the
 *                      "System.IApplicationDescription" 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
{

#if !ECMA_COMPAT

// Framework 1.2
public interface IApplicationDescription
{
        // Get the URL that identifies the application code base.
        String ApplicationCodeBase { get; }

        // Get the contents of the application manifest file.
        String ApplicationManifest { get; }

        // Get the path to the application manifest file.
        String ApplicationManifestPath { get; }

        // Get the URL that identifies the deployment code base.
        String DeploymentCodeBase { get; }

        // Get the contents of the deployment manifest file.
        String DeploymentManifest { get; }

        // Get the path to the deployment manifest file.
        String DeploymentManifestPath { get; }

}; // interface IApplicationDescription

#endif // !ECMA_COMPAT

}; // namespace System

--- NEW FILE: ProvideAssemblyEvidenceEventHandler.cs ---
/*
 * ProvideAssemblyEvidenceEventHandler.cs - Implementation of the
 *                      "System.ProvideAssemblyEvidenceEventHandler" 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
{

#if CONFIG_POLICY_OBJECTS

using System.Security.Policy;

// Framework 1.2
public delegate void ProvideAssemblyEvidenceEventHandler
                (Object sender, ProvideAssemblyEvidenceEventArgs e);

#endif // CONFIG_POLICY_OBJECTS

}; // namespace System

--- NEW FILE: IHostContext.cs ---
/*
 * IHostContext.cs - Implementation of the "System.IHostContext" 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
{

#if !ECMA_COMPAT

// Framework 1.2
public interface IHostContext
{
        // Determine if the launching code can assume trust in the application.
        bool AssumeTrust { get; }

        // Determine if permission sets should only grant what is required.
        bool ExclusiveGrant { get; }

        // True to remove any previous cached trust information.
        bool IsFirstTimeInstall { get; }

        // Determine if the trust manager should suppress prompts.
        bool NoPrompt { get; }

        // Determine if permission information should be persisted.
        bool Persist { get; }

}; // interface IHostContext

#endif // !ECMA_COMPAT

}; // namespace System

--- NEW FILE: __ComObject.cs ---
/*
 * __ComObject.cs - Implementation of the "System.__ComObject" 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
{

#if CONFIG_COM_INTEROP

// Framework 1.2
public class __ComObject : MarshalByRefObject
{
        // Constructor.
        public __ComObject() {}

}; // class __ComObject

#endif // CONFIG_COM_INTEROP

}; // namespace System





reply via email to

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