~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Main/ICSharpCode.SharpDevelop.Sda/Src/StartupSettings.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Collections.Generic;
 
6
 
 
7
namespace ICSharpCode.SharpDevelop.Sda
 
8
{
 
9
        /// <summary>
 
10
        /// This class contains properties you can use to control how SharpDevelop is launched.
 
11
        /// </summary>
 
12
        [Serializable]
 
13
        public sealed class StartupSettings
 
14
        {
 
15
                bool useSharpDevelopErrorHandler = true;
 
16
                string applicationName = "SharpDevelop";
 
17
                string applicationRootPath;
 
18
                bool allowAddInConfigurationAndExternalAddIns = true;
 
19
                bool allowUserAddIns;
 
20
                string propertiesName;
 
21
                string configDirectory;
 
22
                string dataDirectory;
 
23
                string domPersistencePath;
 
24
                string resourceAssemblyName = "SharpDevelop";
 
25
                internal List<string> addInDirectories = new List<string>();
 
26
                internal List<string> addInFiles = new List<string>();
 
27
                
 
28
                /// <summary>
 
29
                /// Gets/Sets the name of the assembly to load the BitmapResources
 
30
                /// and English StringResources from.
 
31
                /// </summary>
 
32
                public string ResourceAssemblyName {
 
33
                        get { return resourceAssemblyName; }
 
34
                        set {
 
35
                                if (value == null)
 
36
                                        throw new ArgumentNullException("value");
 
37
                                resourceAssemblyName = value;
 
38
                        }
 
39
                }
 
40
                
 
41
                /// <summary>
 
42
                /// Gets/Sets whether the SharpDevelop exception box should be used for
 
43
                /// unhandled exceptions. The default is true.
 
44
                /// </summary>
 
45
                public bool UseSharpDevelopErrorHandler {
 
46
                        get { return useSharpDevelopErrorHandler; }
 
47
                        set { useSharpDevelopErrorHandler = value; }
 
48
                }
 
49
                
 
50
                /// <summary>
 
51
                /// Use the file <see cref="ConfigDirectory"/>\AddIns.xml to maintain
 
52
                /// a list of deactivated AddIns and list of AddIns to load from
 
53
                /// external locations.
 
54
                /// The default value is true.
 
55
                /// </summary>
 
56
                public bool AllowAddInConfigurationAndExternalAddIns {
 
57
                        get { return allowAddInConfigurationAndExternalAddIns; }
 
58
                        set { allowAddInConfigurationAndExternalAddIns = value; }
 
59
                }
 
60
                
 
61
                /// <summary>
 
62
                /// Allow user AddIns stored in the "application data" directory.
 
63
                /// The default is false.
 
64
                /// </summary>
 
65
                public bool AllowUserAddIns {
 
66
                        get { return allowUserAddIns; }
 
67
                        set { allowUserAddIns = value; }
 
68
                }
 
69
                
 
70
                /// <summary>
 
71
                /// Gets/Sets the application name used by the MessageService and some
 
72
                /// SharpDevelop windows. The default is "SharpDevelop".
 
73
                /// </summary>
 
74
                public string ApplicationName {
 
75
                        get { return applicationName; }
 
76
                        set {
 
77
                                if (value == null)
 
78
                                        throw new ArgumentNullException("value");
 
79
                                applicationName = value;
 
80
                        }
 
81
                }
 
82
                
 
83
                /// <summary>
 
84
                /// Gets/Sets the application root path to use.
 
85
                /// Use null (default) to use the base directory of the SharpDevelop AppDomain.
 
86
                /// </summary>
 
87
                public string ApplicationRootPath {
 
88
                        get { return applicationRootPath; }
 
89
                        set { applicationRootPath = value; }
 
90
                }
 
91
                
 
92
                /// <summary>
 
93
                /// Gets/Sets the directory used to store SharpDevelop properties,
 
94
                /// settings and user AddIns.
 
95
                /// Use null (default) to use "ApplicationData\ApplicationName"
 
96
                /// </summary>
 
97
                public string ConfigDirectory {
 
98
                        get { return configDirectory; }
 
99
                        set { configDirectory = value; }
 
100
                }
 
101
                
 
102
                /// <summary>
 
103
                /// Sets the data directory used to load resources.
 
104
                /// Use null (default) to use the default path "ApplicationRootPath\data".
 
105
                /// </summary>
 
106
                public string DataDirectory {
 
107
                        get { return dataDirectory; }
 
108
                        set { dataDirectory = value; }
 
109
                }
 
110
                
 
111
                /// <summary>
 
112
                /// Sets the name used for the properties file (without path or extension).
 
113
                /// Use null (default) to use the default name.
 
114
                /// </summary>
 
115
                public string PropertiesName {
 
116
                        get { return propertiesName; }
 
117
                        set { propertiesName = value; }
 
118
                }
 
119
                
 
120
                /// <summary>
 
121
                /// Sets the directory used to store the code completion cache.
 
122
                /// Use null (default) to disable the code completion cache.
 
123
                /// </summary>
 
124
                public string DomPersistencePath {
 
125
                        get { return domPersistencePath; }
 
126
                        set { domPersistencePath = value; }
 
127
                }
 
128
                
 
129
                /// <summary>
 
130
                /// Find AddIns by searching all .addin files recursively in <paramref name="addInDir"/>.
 
131
                /// </summary>
 
132
                public void AddAddInsFromDirectory(string addInDir)
 
133
                {
 
134
                        if (addInDir == null)
 
135
                                throw new ArgumentNullException("addInDir");
 
136
                        addInDirectories.Add(addInDir);
 
137
                }
 
138
                
 
139
                /// <summary>
 
140
                /// Add the specified .addin file.
 
141
                /// </summary>
 
142
                public void AddAddInFile(string addInFile)
 
143
                {
 
144
                        if (addInFile == null)
 
145
                                throw new ArgumentNullException("addInFile");
 
146
                        addInFiles.Add(addInFile);
 
147
                }
 
148
        }
 
149
}