PageRenderTime 32ms CodeModel.GetById 13ms app.highlight 13ms RepoModel.GetById 2ms app.codeStats 0ms

/tags/stable-1.1.0/Client/Config/PHPConfigIssue.cs

#
C# | 140 lines | 119 code | 13 blank | 8 comment | 0 complexity | bc84ff8cd8a2f137a7076a17f5a1f22c 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
 10namespace Web.Management.PHP.Config
 11{
 12
 13    internal static class PHPConfigIssueIndex
 14    {
 15        public const int DefaultDocument = 0;
 16        public const int ResourceType = 1;
 17        public const int PHPMaxRequests = 2;
 18        public const int PHPRC = 3;
 19        public const int MonitorChangesTo = 4;
 20        public const int ExtensionDir = 5;
 21        public const int LogErrors = 6;
 22        public const int ErrorLog = 7;
 23        public const int SessionPath = 8;
 24        public const int CgiForceRedirect = 9;
 25        public const int CgiPathInfo = 10;
 26        public const int FastCgiImpersonation = 11;
 27        public const int UploadDir = 12;
 28        public const int DateTimeZone = 13;
 29    }
 30
 31    internal class PHPConfigIssue : IRemoteObject
 32    {
 33        private object[] _data;
 34        private const int Size = 6;
 35        private const int IndexName = 0;
 36        private const int IndexCurrentValue = 1;
 37        private const int IndexRecommendeValue = 2;
 38        private const int IndexIssueDescription = 3;
 39        private const int IndexRecommendation = 4;
 40        private const int IndexIssueIndex = 5;
 41
 42        public PHPConfigIssue()
 43        {
 44            _data = new object[Size];
 45        }
 46
 47        public PHPConfigIssue(string name, string currentValue, string recommendedValue, string issueDescription, string recommendation, int issueIndex)
 48        {
 49            _data = new object[Size];
 50            SettingName = name;
 51            CurrentValue = currentValue;
 52            RecommendedValue = recommendedValue;
 53            IssueDescription = issueDescription;
 54            Recommendation = recommendation;
 55            IssueIndex = issueIndex;
 56        }
 57
 58        public string CurrentValue
 59        {
 60            get
 61            {
 62                return (string)_data[IndexCurrentValue];
 63            }
 64            set
 65            {
 66                _data[IndexCurrentValue] = value;
 67            }
 68        }
 69
 70        public string IssueDescription
 71        {
 72            get
 73            {
 74                return (string)_data[IndexIssueDescription];
 75            }
 76            set
 77            {
 78                _data[IndexIssueDescription] = value;
 79            }
 80        }
 81
 82        public int IssueIndex
 83        {
 84            get
 85            {
 86                return (int)_data[IndexIssueIndex];
 87            }
 88            set
 89            {
 90                _data[IndexIssueIndex] = value;
 91            }
 92        }
 93
 94        public string Recommendation
 95        {
 96            get
 97            {
 98                return (string)_data[IndexRecommendation];
 99            }
100            set
101            {
102                _data[IndexRecommendation] = value;
103            }
104        }
105
106        public string RecommendedValue
107        {
108            get
109            {
110                return (string)_data[IndexRecommendeValue];
111            }
112            set
113            {
114                _data[IndexRecommendeValue] = value;
115            }
116        }
117
118        public string SettingName
119        {
120            get
121            {
122                return (string)_data[IndexName];
123            }
124            set
125            {
126                _data[IndexName] = value;
127            }
128        }
129
130        public object GetData()
131        {
132            return _data;
133        }
134
135        public void SetData(object o)
136        {
137            _data = (object[])o;
138        }
139    }
140}