PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Client/Config/PHPConfigInfo.cs

#
C# | 180 lines | 152 code | 20 blank | 8 comment | 0 complexity | 0c3505dd70abcf72bdc49d88e6e45051 MD5 | raw file
  1//-----------------------------------------------------------------------
  2// <copyright>
  3// Copyright (C) Ruslan Yakushev for the PHP Manager for IIS project.
  4//
  5// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
  6// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
  7// </copyright>
  8//----------------------------------------------------------------------- 
  9
 10using System;
 11
 12namespace Web.Management.PHP.Config
 13{
 14
 15    public sealed class PHPConfigInfo : IRemoteObject
 16    {
 17        private object[] _data;
 18
 19        private const int IndexPhpRegistrationType = 0;
 20        private const int IndexHandlerName = 1;
 21        private const int IndexHandlerIsLocal = 2;
 22        private const int IndexExecutable = 3;
 23        private const int IndexVersion = 4;
 24        private const int IndexPhpIniFilePath = 5;
 25        private const int IndexErrorLog = 6;
 26        private const int IndexEnabledExtCount = 7;
 27        private const int IndexInstalledExtCount = 8;
 28        private const int IndexIsConfigOptimal = 9;
 29
 30        private const int Size = 10;
 31
 32        public PHPConfigInfo()
 33        {
 34            _data = new object[Size];
 35            HandlerName = String.Empty;
 36            HandlerIsLocal = false;
 37            Executable = String.Empty;
 38            Version = String.Empty;
 39            PHPIniFilePath = String.Empty;
 40            ErrorLog = String.Empty;
 41            EnabledExtCount = 0;
 42            InstalledExtCount = 0;
 43            IsConfigOptimal = false;
 44        }
 45
 46        public int EnabledExtCount
 47        {
 48            get
 49            {
 50                return (int)_data[IndexEnabledExtCount];
 51            }
 52            set
 53            {
 54                _data[IndexEnabledExtCount] = value;
 55            }
 56        }
 57
 58        public string ErrorLog
 59        {
 60            get
 61            {
 62                return (string)_data[IndexErrorLog];
 63            }
 64            set
 65            {
 66                _data[IndexErrorLog] = value;
 67            }
 68        }
 69
 70        public string Executable
 71        {
 72            get
 73            {
 74                return (string)_data[IndexExecutable];
 75            }
 76            set
 77            {
 78                _data[IndexExecutable] = value;
 79            }
 80        }
 81
 82        public bool HandlerIsLocal
 83        {
 84            get
 85            {
 86                return (bool)_data[IndexHandlerIsLocal];
 87            }
 88            set
 89            {
 90                _data[IndexHandlerIsLocal] = value;
 91            }
 92        }
 93
 94        public string HandlerName
 95        {
 96            get
 97            {
 98                return (string)_data[IndexHandlerName];
 99            }
100            set
101            {
102                _data[IndexHandlerName] = value;
103            }
104        }
105
106        public int InstalledExtCount
107        {
108            get
109            {
110                return (int)_data[IndexInstalledExtCount];
111            }
112            set
113            {
114                _data[IndexInstalledExtCount] = value;
115            }
116        }
117
118        public bool IsConfigOptimal
119        {
120            get
121            {
122                return (bool)_data[IndexIsConfigOptimal];
123            }
124            set
125            {
126                _data[IndexIsConfigOptimal] = value;
127            }
128        }
129
130        public string PHPIniFilePath
131        {
132            get
133            {
134                return (string)_data[IndexPhpIniFilePath];
135            }
136            set
137            {
138                _data[IndexPhpIniFilePath] = value;
139            }
140        }
141
142        public PHPRegistrationType RegistrationType
143        {
144            get
145            {
146                return (PHPRegistrationType)_data[IndexPhpRegistrationType];
147            }
148            set
149            {
150                _data[IndexPhpRegistrationType] = (int)value;
151            }
152        }
153
154        public string Version
155        {
156            get
157            {
158                return (string)_data[IndexVersion];
159            }
160            set
161            {
162                _data[IndexVersion] = value;
163            }
164        }
165
166        #region IRemoteObject Members
167
168        public object GetData()
169        {
170            return _data;
171        }
172
173        public void SetData(object o)
174        {
175            _data = (object[])o;
176        }
177
178        #endregion
179    }
180}