Skip to content

Commit 6ec7f2d

Browse files
committed
Merge pull request #847 from SlavaRa/feature/refactoring
Cleanup of dependencies and small refactorings
2 parents 7c1e378 + e6485cf commit 6ec7f2d

File tree

504 files changed

+1968
-2719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

504 files changed

+1968
-2719
lines changed

External/Plugins/AS2Context/AS2Context.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,8 @@
9090
</ItemGroup>
9191
<ItemGroup>
9292
<Reference Include="System" />
93-
<Reference Include="System.Data" />
94-
<Reference Include="System.Design" />
9593
<Reference Include="System.Drawing" />
96-
<Reference Include="System.Drawing.Design" />
9794
<Reference Include="System.Windows.Forms" />
98-
<Reference Include="System.Xml" />
9995
</ItemGroup>
10096
<ItemGroup>
10197
<BootstrapperPackage Include=".NETFramework,Version=v4.0">

External/Plugins/AS2Context/AS2Settings.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42
using System.ComponentModel;
53
using System.Drawing.Design;
6-
using System.Windows.Forms;
7-
using System.Windows.Forms.Design;
8-
using System.IO;
9-
using ASCompletion.Context;
4+
using ASCompletion.Settings;
105
using Ookii.Dialogs;
11-
using PluginCore.Localization;
126
using PluginCore;
7+
using PluginCore.Localization;
138

149
namespace AS2Context
1510
{
1611
public delegate void ClasspathChangedEvent();
1712

1813
[Serializable]
19-
public class AS2Settings : ASCompletion.Settings.IContextSettings
14+
public class AS2Settings : IContextSettings
2015
{
2116
[field: NonSerialized]
2217
public event ClasspathChangedEvent OnClasspathChanged;

External/Plugins/AS2Context/Context.cs

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
using System;
2-
using System.Collections;
3-
using System.Collections.Specialized;
42
using System.Collections.Generic;
5-
using System.Text.RegularExpressions;
63
using System.IO;
7-
using System.Diagnostics;
8-
using System.Windows.Forms;
9-
using PluginCore;
10-
using PluginCore.Managers;
11-
using PluginCore.Controls;
12-
using ASCompletion.Context;
4+
using System.Text.RegularExpressions;
135
using ASCompletion.Completion;
6+
using ASCompletion.Context;
147
using ASCompletion.Model;
158
using ASCompletion.Settings;
16-
using PluginCore.Localization;
9+
using PluginCore;
10+
using PluginCore.Controls;
1711
using PluginCore.Helpers;
12+
using PluginCore.Localization;
13+
using PluginCore.Managers;
1814

1915
namespace AS2Context
2016
{
@@ -169,28 +165,28 @@ public override void BuildClassPath()
169165

170166
string path;
171167
if ((as2settings.UseMtascIntrinsic || String.IsNullOrEmpty(as2settings.MMClassPath))
172-
&& !String.IsNullOrEmpty(mtascPath) && System.IO.Directory.Exists(mtascPath))
168+
&& !String.IsNullOrEmpty(mtascPath) && Directory.Exists(mtascPath))
173169
{
174170
try
175171
{
176172
if (majorVersion == 9)
177173
{
178174
path = Path.Combine(mtascPath, "std9");
179-
if (System.IO.Directory.Exists(path)) AddPath(path);
175+
if (Directory.Exists(path)) AddPath(path);
180176
else majorVersion = 8;
181177
}
182178
if (majorVersion == 8)
183179
{
184180
path = Path.Combine(mtascPath, "std8");
185-
if (System.IO.Directory.Exists(path)) AddPath(path);
181+
if (Directory.Exists(path)) AddPath(path);
186182
}
187183
path = Path.Combine(mtascPath, "std");
188-
if (System.IO.Directory.Exists(path)) AddPath(path);
184+
if (Directory.Exists(path)) AddPath(path);
189185
}
190186
catch {}
191187
}
192188
// Macromedia/Adobe
193-
if (!String.IsNullOrEmpty(as2settings.MMClassPath) && System.IO.Directory.Exists(as2settings.MMClassPath))
189+
if (!String.IsNullOrEmpty(as2settings.MMClassPath) && Directory.Exists(as2settings.MMClassPath))
194190
{
195191
if (classPath.Count == 0)
196192
{
@@ -199,13 +195,13 @@ public override void BuildClassPath()
199195
if (tempVersion > 8)
200196
{
201197
path = Path.Combine(as2settings.MMClassPath, "FP" + tempVersion);
202-
if (System.IO.Directory.Exists(path))
198+
if (Directory.Exists(path))
203199
AddPath(path);
204200
// now add FP8
205201
tempVersion = 8;
206202
}
207203
path = Path.Combine(as2settings.MMClassPath, "FP" + Math.Max(7, tempVersion));
208-
if (System.IO.Directory.Exists(path))
204+
if (Directory.Exists(path))
209205
{
210206
PathModel aPath = new PathModel(path, this);
211207
ManualExploration(aPath, new string[] { "aso", "FP7", "FP8", "FP9" });
@@ -342,22 +338,22 @@ public override void ResolveTopLevelElement(string token, ASResult result)
342338
if (topLevel != null && topLevel.Members.Count > 0)
343339
{
344340
// current class
345-
ClassModel inClass = ASContext.Context.CurrentClass;
341+
ClassModel inClass = Context.CurrentClass;
346342
if (token == "this")
347343
{
348344
result.Member = topLevel.Members.Search("this", 0, 0);
349345
if (inClass.IsVoid())
350-
inClass = ASContext.Context.ResolveType(result.Member.Type, null);
346+
inClass = Context.ResolveType(result.Member.Type, null);
351347
result.Type = inClass;
352-
result.InFile = ASContext.Context.CurrentModel;
348+
result.InFile = Context.CurrentModel;
353349
return;
354350
}
355351
else if (token == "super")
356352
{
357353
if (inClass.IsVoid())
358354
{
359355
MemberModel thisMember = topLevel.Members.Search("this", 0, 0);
360-
inClass = ASContext.Context.ResolveType(thisMember.Type, null);
356+
inClass = Context.ResolveType(thisMember.Type, null);
361357
}
362358
inClass.ResolveExtends();
363359
ClassModel extends = inClass.Extends;
@@ -453,10 +449,10 @@ public override MemberList ResolveImports(FileModel inFile)
453449
/// <param name="atLine">Position in the file</param>
454450
public override bool IsImported(MemberModel member, int atLine)
455451
{
456-
FileModel cFile = ASContext.Context.CurrentModel;
452+
FileModel cFile = Context.CurrentModel;
457453
string fullName = member.Type;
458454
string name = member.Name;
459-
int lineMin = (ASContext.Context.InPrivateSection) ? cFile.PrivateSectionIndex : 0;
455+
int lineMin = (Context.InPrivateSection) ? cFile.PrivateSectionIndex : 0;
460456
int lineMax = atLine;
461457
foreach (MemberModel import in cFile.Imports)
462458
{
@@ -991,7 +987,7 @@ public override FileModel ResolvePackage(string name, bool lazyMode)
991987
if (lazyMode || settings.LazyClasspathExploration || aPath.IsTemporaryPath)
992988
{
993989
string path = Path.Combine(aPath.Path, packagePath);
994-
if (aPath.IsValid && System.IO.Directory.Exists(path))
990+
if (aPath.IsValid && Directory.Exists(path))
995991
{
996992
try
997993
{
@@ -1058,7 +1054,7 @@ private void PopulateClassesEntries(string package, string path, MemberList memb
10581054
string[] fileEntries = null;
10591055
try
10601056
{
1061-
fileEntries = System.IO.Directory.GetFiles(path, "*" + settings.DefaultExtension);
1057+
fileEntries = Directory.GetFiles(path, "*" + settings.DefaultExtension);
10621058
}
10631059
catch { }
10641060
if (fileEntries == null) return;
@@ -1083,7 +1079,7 @@ private void PopulatePackageEntries(string package, string path, MemberList memb
10831079
string[] dirEntries = null;
10841080
try
10851081
{
1086-
dirEntries = System.IO.Directory.GetDirectories(path);
1082+
dirEntries = Directory.GetDirectories(path);
10871083
}
10881084
catch { }
10891085
if (dirEntries == null) return;
@@ -1376,7 +1372,7 @@ public override bool BuildCMD(bool failSilently)
13761372
{
13771373
command = Regex.Replace(command, "[\\r\\n]\\s*\\*", "", RegexOptions.Singleline);
13781374
command = " " + MainForm.ProcessArgString(command) + " ";
1379-
if (command == null || command.Length == 0)
1375+
if (string.IsNullOrEmpty(command))
13801376
{
13811377
if (!failSilently)
13821378
throw new Exception(TextHelper.GetString("Info.InvalidQuickBuildCommand"));

External/Plugins/AS2Context/PluginMain.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
using System;
2-
using System.IO;
2+
using System.Collections.Generic;
33
using System.ComponentModel;
4-
using WeifenLuo.WinFormsUI;
4+
using System.Globalization;
5+
using System.IO;
6+
using System.Text.RegularExpressions;
7+
using ASCompletion.Context;
8+
using PluginCore;
9+
using PluginCore.Helpers;
510
using PluginCore.Localization;
611
using PluginCore.Managers;
712
using PluginCore.Utilities;
8-
using PluginCore.Helpers;
9-
using PluginCore;
10-
using System.Text.RegularExpressions;
11-
using System.Collections.Generic;
1213

1314
namespace AS2Context
1415
{
@@ -115,7 +116,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
115116
contextInstance = new Context(settingObject);
116117
ValidateSettings();
117118
// Associate this context with AS2 language
118-
ASCompletion.Context.ASContext.RegisterLanguage(contextInstance, "as2");
119+
ASContext.RegisterLanguage(contextInstance, "as2");
119120
break;
120121
}
121122
}
@@ -289,26 +290,26 @@ public bool ValidateSDK(InstalledSDK sdk)
289290
static private string FindMMClassPath()
290291
{
291292
bool found = false;
292-
string deflang = System.Globalization.CultureInfo.CurrentUICulture.Name;
293+
string deflang = CultureInfo.CurrentUICulture.Name;
293294
deflang = deflang.Substring(0, 2);
294295
string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
295296
string cp = "";
296297
foreach (string path in MACROMEDIA_VERSIONS)
297298
{
298299
cp = localAppData + path;
299300
// default language
300-
if (System.IO.Directory.Exists(cp + deflang + "\\Configuration\\Classes\\"))
301+
if (Directory.Exists(cp + deflang + "\\Configuration\\Classes\\"))
301302
{
302303
cp += deflang + "\\Configuration\\Classes\\";
303304
found = true;
304305
}
305306
// look for other languages
306-
else if (System.IO.Directory.Exists(cp))
307+
else if (Directory.Exists(cp))
307308
{
308-
string[] dirs = System.IO.Directory.GetDirectories(cp);
309+
string[] dirs = Directory.GetDirectories(cp);
309310
foreach (string dir in dirs)
310311
{
311-
if (System.IO.Directory.Exists(dir + "\\Configuration\\Classes\\"))
312+
if (Directory.Exists(dir + "\\Configuration\\Classes\\"))
312313
{
313314
cp = dir + "\\Configuration\\Classes\\";
314315
found = true;
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
3-
using System.Runtime.InteropServices;
2+
using PluginCore;
43

54
// Information about this assembly is defined by the following attributes.
65
// Change them to the information which is associated with the assembly you compile.
76
[assembly: AssemblyTitle("AS2Context")]
8-
[assembly: AssemblyDescription("AS2Context Plugin For ASCompletion In " + PluginCore.DistroConfig.DISTRIBUTION_NAME)]
7+
[assembly: AssemblyDescription("AS2Context Plugin For ASCompletion In " + DistroConfig.DISTRIBUTION_NAME)]
98
[assembly: AssemblyConfiguration("")]
10-
[assembly: AssemblyCompany(PluginCore.DistroConfig.DISTRIBUTION_COMPANY)]
9+
[assembly: AssemblyCompany(DistroConfig.DISTRIBUTION_COMPANY)]
1110
[assembly: AssemblyProduct("AS2Context")]
12-
[assembly: AssemblyCopyright(PluginCore.DistroConfig.DISTRIBUTION_COPYRIGHT)]
11+
[assembly: AssemblyCopyright(DistroConfig.DISTRIBUTION_COPYRIGHT)]
1312
[assembly: AssemblyTrademark("")]
1413
[assembly: AssemblyCulture("")]
1514
[assembly: AssemblyVersion("1.0.0.0")]

External/Plugins/AS3Context/AS3Context.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@
113113
<Private>False</Private>
114114
</Reference>
115115
<Reference Include="System" />
116-
<Reference Include="System.Data" />
117-
<Reference Include="System.Design" />
118116
<Reference Include="System.Drawing" />
119-
<Reference Include="System.Drawing.Design" />
120117
<Reference Include="System.Windows.Forms" />
121118
<Reference Include="System.Xml" />
122119
</ItemGroup>

External/Plugins/AS3Context/AS3Settings.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using System.Drawing.Design;
5-
using System.Windows.Forms.Design;
62
using System.ComponentModel;
7-
using PluginCore.Localization;
8-
using PluginCore;
9-
using System.IO;
3+
using System.Drawing.Design;
4+
using ASCompletion.Settings;
105
using Ookii.Dialogs;
6+
using PluginCore;
7+
using PluginCore.Localization;
118

129
namespace AS3Context
1310
{
1411
public delegate void ClasspathChangedEvent();
1512
public delegate void InstalledSDKsChangedEvent();
1613

1714
[Serializable]
18-
public class AS3Settings : ASCompletion.Settings.IContextSettings
15+
public class AS3Settings : IContextSettings
1916
{
2017
[field: NonSerialized]
2118
public event ClasspathChangedEvent OnClasspathChanged;

External/Plugins/AS3Context/AbcConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
using System.Collections.Generic;
33
using System.Globalization;
44
using System.IO;
5+
using System.Text;
56
using System.Text.RegularExpressions;
67
using System.Xml;
78
using ASCompletion.Context;
89
using ASCompletion.Model;
910
using SwfOp;
1011
using SwfOp.Data;
1112

12-
1313
namespace AS3Context
1414
{
1515
#region AbcConverter class: ABC model builder
@@ -497,7 +497,7 @@ private static MemberModel GetMember(MemberInfo info, FlagType baseFlags)
497497
{
498498
if (metaInfo.name == "__go_to_definition_help") continue;
499499
var meta = new ASMetaData(metaInfo.name);
500-
var rawParams = new System.Text.StringBuilder();
500+
var rawParams = new StringBuilder();
501501
meta.Params = new Dictionary<string, string>(metaInfo.Count);
502502
foreach (var entry in metaInfo)
503503
{

External/Plugins/AS3Context/Compiler/FdbWrapper.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Text;
43
using System.Diagnostics;
5-
using System.Threading;
64
using System.IO;
5+
using System.Text;
76
using System.Text.RegularExpressions;
7+
using System.Threading;
88
using PluginCore.Helpers;
9-
using System.Collections;
109

1110
namespace AS3Context.Compiler
1211
{

External/Plugins/AS3Context/Compiler/FlexDebugger.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using PluginCore;
51
using System.Windows.Forms;
6-
using PluginCore.Managers;
7-
using System.IO;
2+
using PluginCore;
83
using PluginCore.Localization;
4+
using PluginCore.Managers;
95

106
namespace AS3Context.Compiler
117
{

0 commit comments

Comments
 (0)