Skip to content

Commit

Permalink
unification: this. or no this.?
Browse files Browse the repository at this point in the history
  • Loading branch information
makc committed May 9, 2013
1 parent 8ca576f commit 54cf17e
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions ColtPlugin/PluginMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,39 +47,39 @@ public Int32 Api
/// </summary>
public String Name
{
get { return this.pluginName; }
get { return pluginName; }
}

/// <summary>
/// GUID of the plugin
/// </summary>
public String Guid
{
get { return this.pluginGuid; }
get { return pluginGuid; }
}

/// <summary>
/// Author of the plugin
/// </summary>
public String Author
{
get { return this.pluginAuth; }
get { return pluginAuth; }
}

/// <summary>
/// Description of the plugin
/// </summary>
public String Description
{
get { return this.pluginDesc; }
get { return pluginDesc; }
}

/// <summary>
/// Web address for help
/// </summary>
public String Help
{
get { return this.pluginHelp; }
get { return pluginHelp; }
}

/// <summary>
Expand All @@ -88,7 +88,7 @@ public String Help
[Browsable(false)]
public Object Settings
{
get { return this.settingObject; }
get { return settingObject; }
}

#endregion
Expand All @@ -100,18 +100,18 @@ public Object Settings
/// </summary>
public void Initialize()
{
this.InitBasics();
this.LoadSettings();
this.InitLocalization();
this.AddEventHandlers();
InitBasics();
LoadSettings();
InitLocalization();
AddEventHandlers();
}

/// <summary>
/// Disposes the plugin
/// </summary>
public void Dispose()
{
this.SaveSettings();
SaveSettings();
}

/// <summary>
Expand All @@ -127,8 +127,8 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
{
IProject project = PluginBase.CurrentProject;
Boolean as3projectIsOpen = (project != null) && (project.Language == "as3");
if (this.menuItem != null) this.menuItem.Enabled = as3projectIsOpen;
if (this.toolbarButton != null) this.toolbarButton.Enabled = as3projectIsOpen;
if (menuItem != null) menuItem.Enabled = as3projectIsOpen;
if (toolbarButton != null) toolbarButton.Enabled = as3projectIsOpen;
// deactivate if project is closed
active &= as3projectIsOpen;
if (watcher != null) watcher.EnableRaisingEvents &= as3projectIsOpen;
Expand All @@ -141,12 +141,12 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
else if (cmd == "ProjectManager.Menu")
{
Object menu = (e as DataEvent).Data;
this.CreateMenuItem(menu as ToolStripMenuItem);
CreateMenuItem(menu as ToolStripMenuItem);
}
else if (cmd == "ProjectManager.ToolBar")
{
Object toolStrip = (e as DataEvent).Data;
this.CreateToolbarButton(toolStrip as ToolStrip);
CreateToolbarButton(toolStrip as ToolStrip);
}
break;
}
Expand All @@ -163,7 +163,7 @@ public void InitBasics()
{
String dataPath = Path.Combine(PathHelper.DataDir, "ColtPlugin");
if (!Directory.Exists(dataPath)) Directory.CreateDirectory(dataPath);
this.settingFilename = Path.Combine(dataPath, "Settings.fdb");
settingFilename = Path.Combine(dataPath, "Settings.fdb");
}

/// <summary>
Expand All @@ -185,8 +185,8 @@ public void InitLocalization()
LocaleHelper.Initialize(LocaleVersion.en_US);
break;
}
this.pluginDesc = LocaleHelper.GetString("Info.Description");
this.buttonText = LocaleHelper.GetString("Info.ButtonText");
pluginDesc = LocaleHelper.GetString("Info.Description");
buttonText = LocaleHelper.GetString("Info.ButtonText");
}

/// <summary>
Expand All @@ -207,18 +207,18 @@ public void AddEventHandlers()

private void CreateMenuItem(ToolStripMenuItem projectMenu)
{
this.menuItem = new ToolStripMenuItem(buttonText, GetImage("colt.png"), new EventHandler(this.OnClick), null);
projectMenu.DropDownItems.Add(this.menuItem);
menuItem = new ToolStripMenuItem(buttonText, GetImage("colt.png"), new EventHandler(OnClick), null);
projectMenu.DropDownItems.Add(menuItem);
}

private void CreateToolbarButton(ToolStrip toolStrip)
{
this.toolbarButton = new ToolStripButton();
this.toolbarButton.Image = GetImage("colt.png");
this.toolbarButton.Text = buttonText;
this.toolbarButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
this.toolbarButton.Click += new EventHandler(this.OnClick);
toolStrip.Items.Add(this.toolbarButton);
toolbarButton = new ToolStripButton();
toolbarButton.Image = GetImage("colt.png");
toolbarButton.Text = buttonText;
toolbarButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
toolbarButton.Click += new EventHandler(OnClick);
toolStrip.Items.Add(toolbarButton);
}

/// <summary>
Expand Down Expand Up @@ -246,12 +246,12 @@ private void OnClick(Object sender, System.EventArgs e)
/// </summary>
public void LoadSettings()
{
this.settingObject = new Settings();
if (!File.Exists(this.settingFilename)) this.SaveSettings();
settingObject = new Settings();
if (!File.Exists(settingFilename)) SaveSettings();
else
{
Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
this.settingObject = (Settings)obj;
Object obj = ObjectSerializer.Deserialize(settingFilename, settingObject);
settingObject = (Settings)obj;
}
}

Expand All @@ -260,7 +260,7 @@ public void LoadSettings()
/// </summary>
public void SaveSettings()
{
ObjectSerializer.Serialize(this.settingFilename, this.settingObject);
ObjectSerializer.Serialize(settingFilename, settingObject);
}

#endregion
Expand All @@ -269,7 +269,7 @@ private void OnFileChange(Object sender, FileSystemEventArgs e)
{
if (Path.GetFileName(e.FullPath).Contains("compile_errors.log"))
{
/* This hangs FD :( now if someone could fix this...
/* This hangs FD :( now if someone could fix ..
*
StreamReader stream = File.OpenText(e.FullPath);
String errors = stream.ReadToEnd(); stream.Close();
Expand All @@ -295,7 +295,7 @@ private void OpenInCOLT()
AS3Project project = (AS3Project)PluginBase.CurrentProject;

String configCopy = "";
if (this.settingObject.FullConfig)
if (settingObject.FullConfig)
{
// Construct flex config file name (see AS3ProjectBuilder, line 140)
String projectName = project.Name.Replace(" ", "");
Expand Down Expand Up @@ -323,7 +323,7 @@ private void OpenInCOLT()


// Create COLT subfolder if does not exist yet
String coltFolderPath = project.GetAbsolutePath(this.settingObject.WorkingFolder);
String coltFolderPath = project.GetAbsolutePath(settingObject.WorkingFolder);
if (!Directory.Exists(coltFolderPath)) Directory.CreateDirectory(coltFolderPath);

// While at that, start listening for colt/compile_errors.log changes
Expand All @@ -337,7 +337,7 @@ private void OpenInCOLT()
watcher.EnableRaisingEvents = true;

// Create COLT project with random name (if we'd update same file - are there file locks? how to reopen in colt?)
String coltFileName = project.GetAbsolutePath(Path.Combine(this.settingObject.WorkingFolder, System.Guid.NewGuid() + ".colt"));
String coltFileName = project.GetAbsolutePath(Path.Combine(settingObject.WorkingFolder, System.Guid.NewGuid() + ".colt"));
StreamWriter stream = File.CreateText(coltFileName);


Expand All @@ -364,7 +364,7 @@ private void OpenInCOLT()

stream.WriteLine("liveMethods=annotated");

if (this.settingObject.FullConfig)
if (settingObject.FullConfig)
{
stream.WriteLine("compilerOptions=-load-config+\\=\"" + EscapeForCOLT(project.GetAbsolutePath(configCopy)) + "\"");
}
Expand Down

0 comments on commit 54cf17e

Please # to comment.