diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-04-25 11:19:13 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-04-25 11:19:13 +0200 |
commit | 7e874613ff22bedf988273b51a15ab937f01169f (patch) | |
tree | 115a92a902f80fcc6252c5fac6a957ecc548b82c /vsaddin/src | |
parent | Fixed copyrights (diff) | |
download | ice-7e874613ff22bedf988273b51a15ab937f01169f.tar.bz2 ice-7e874613ff22bedf988273b51a15ab937f01169f.tar.xz ice-7e874613ff22bedf988273b51a15ab937f01169f.zip |
Merged Silverlight support
Diffstat (limited to 'vsaddin/src')
-rw-r--r-- | vsaddin/src/Builder.cs | 114 | ||||
-rw-r--r-- | vsaddin/src/Connect.cs | 8 | ||||
-rw-r--r-- | vsaddin/src/ExtraCompilerOptionsView.cs | 15 | ||||
-rwxr-xr-x | vsaddin/src/IceCsharpConfigurationDialog.cs | 85 | ||||
-rw-r--r-- | vsaddin/src/IceSilverlightConfigurationDialog.Designer.cs | 208 | ||||
-rw-r--r-- | vsaddin/src/IceSilverlightConfigurationDialog.cs | 395 | ||||
-rw-r--r-- | vsaddin/src/IceSilverlightConfigurationDialog.resx | 123 | ||||
-rw-r--r-- | vsaddin/src/Util.cs | 74 | ||||
-rwxr-xr-x | vsaddin/src/addin-vs2008.csproj | 11 | ||||
-rwxr-xr-x | vsaddin/src/addin-vs2010.csproj | 9 |
10 files changed, 89 insertions, 953 deletions
diff --git a/vsaddin/src/Builder.cs b/vsaddin/src/Builder.cs index ca1b7b19307..742921af058 100644 --- a/vsaddin/src/Builder.cs +++ b/vsaddin/src/Builder.cs @@ -735,41 +735,20 @@ namespace Ice.VisualStudio { if(Util.isCSharpProject(project)) { - bool development = Util.developmentMode(project); - if(Util.isSilverlightProject(project)) - {
- string iceSlHome = Environment.GetEnvironmentVariable("ICE_SL_HOME");
- if(String.IsNullOrEmpty(iceSlHome))
- {
- MessageBox.Show("ICE_SL_HOME environment variable not set.\n" +
- "ICE_SL_HOME environment variable must be set to point to " +
- "Ice Silverlight installation path.",
- "Ice Visual Studio Add-in", MessageBoxButtons.OK,
- MessageBoxIcon.Error,
- MessageBoxDefaultButton.Button1,
- (MessageBoxOptions)0);
- return; - } - - Util.addDotNetReference(project, "IceSL", Util.getIceSlHome(), development); + bool development = Util.developmentMode(project); + if(components.Count == 0) + { + components = + new ComponentList(Util.getProjectProperty(project, Util.PropertyIceComponents)); } - else + if(!components.Contains("Ice")) { - - if(components.Count == 0) - { - components = - new ComponentList(Util.getProjectProperty(project, Util.PropertyIceComponents)); - } - if(!components.Contains("Ice")) - { - components.Add("Ice"); - } - string iceHome = Util.getIceHome(); - foreach(string component in components) - { - Util.addDotNetReference(project, component, iceHome, development); - } + components.Add("Ice"); + } + string iceHome = Util.getIceHome(); + foreach(string component in components) + { + Util.addDotNetReference(project, component, iceHome, development); } } else if(Util.isVBProject(project)) @@ -811,14 +790,7 @@ namespace Ice.VisualStudio } else if(Util.isCSharpProject(project)) {
- if(Util.isSilverlightProject(project))
- {
- Util.removeDotNetReference(project, "IceSL");
- }
- else
- {
- Util.removeDotNetReference(project, "Ice"); - } + Util.removeDotNetReference(project, "Ice"); } Util.setProjectProperty(project, Util.PropertyIceComponents, components.ToString()); @@ -1606,22 +1578,13 @@ namespace Ice.VisualStudio if(Util.isCSharpProject(project)) { compiler = Util.slice2cs; - if(Util.isSilverlightProject(project)) - { - compiler = Util.slice2sl; - iceHome = Util.getIceSlHome(); - } } return Path.Combine(Path.Combine(iceHome, "bin"), compiler); } public static string getSliceCompilerVersion(Project project, string sliceCompiler) - {
- string iceHome = Util.getIceHome();
- if(Util.isSilverlightProject(project))
- {
- iceHome = Util.getIceSlHome(); - }
+ { + string iceHome = Util.getIceHome(); sliceCompiler = Path.Combine(iceHome, Path.Combine("bin", sliceCompiler)); System.Diagnostics.Process process = new System.Diagnostics.Process(); @@ -1666,20 +1629,6 @@ namespace Ice.VisualStudio process.BeginOutputReadLine(); string version = process.StandardError.ReadToEnd(); process.WaitForExit(); - - if(String.IsNullOrEmpty(version)) - { - // - // Some old version of slice compilers print version - // to StdOut instead of StdErr - // - version = reader.data(); - if(String.IsNullOrEmpty(version)) - { - return ""; - } - } - return version.Trim(); } @@ -1714,15 +1663,7 @@ namespace Ice.VisualStudio args += "--add-header=" + Util.quote(preCompiledHeader) + " "; } } - - if(Util.isSilverlightProject(project)) - { - args += "-I\"" + Util.getIceSlHome() + "\\slice\" "; - } - else - { - args += "-I\"" + Util.getIceHome() + "\\slice\" "; - } + args += "-I\"" + Util.getIceHome() + "\\slice\" "; foreach(string i in includes) { @@ -2575,30 +2516,7 @@ namespace Ice.VisualStudio process.WaitForExit(); - // - // slice2sl <= 0.3 doesn't print all errors to standard error, we check the slice2sl - // version to know if we need to parse standard output for errors. - // - bool standardError = true; - if(Util.isSilverlightProject(project)) - { - string version = getSliceCompilerVersion(project, Util.slice2sl); - List<String> tokens = new List<string>(version.Split(new char[]{'.'}, - StringSplitOptions.RemoveEmptyEntries)); - - int mayor = Int32.Parse(tokens[0], CultureInfo.InvariantCulture); - int minor = Int32.Parse(tokens[1], CultureInfo.InvariantCulture); - if(mayor == 0 && minor <= 3) - { - standardError = false; - } - } - bool hasErrors = parseErrors(project, sliceCompiler, file, stderr); - if(!standardError) - { - hasErrors = hasErrors || parseErrors(project, sliceCompiler, file, reader.data()); - } process.Close(); if(hasErrors) { diff --git a/vsaddin/src/Connect.cs b/vsaddin/src/Connect.cs index 28874349c67..c0f0ddce11d 100644 --- a/vsaddin/src/Connect.cs +++ b/vsaddin/src/Connect.cs @@ -169,16 +169,8 @@ namespace Ice.VisualStudio if(Util.isCSharpProject(project)) { - if(Util.isSilverlightProject(project)) - { - IceSilverlightConfigurationDialog dialog = new IceSilverlightConfigurationDialog(project); - dialog.ShowDialog(); - } - else - { IceCsharpConfigurationDialog dialog = new IceCsharpConfigurationDialog(project); dialog.ShowDialog(); - } } else if(Util.isVBProject(project)) { diff --git a/vsaddin/src/ExtraCompilerOptionsView.cs b/vsaddin/src/ExtraCompilerOptionsView.cs index ea533da13ec..2ac8fe684c1 100644 --- a/vsaddin/src/ExtraCompilerOptionsView.cs +++ b/vsaddin/src/ExtraCompilerOptionsView.cs @@ -98,12 +98,6 @@ namespace Ice.VisualStudio _dialog.needSave(); } - private bool parseSlice2slOptions() - { - Options opts = null; - return Util.parseSlice2slOptions(txtExtraOptions.Text, true, ref opts); - } - private bool parseSlice2csOptions() { Options opts = null; @@ -126,14 +120,7 @@ namespace Ice.VisualStudio } else if(Util.isCSharpProject(_project)) { - if(Util.isSilverlightProject(_project)) - { - return parseSlice2slOptions(); - } - else - { - return parseSlice2csOptions(); - } + return parseSlice2csOptions(); } return true; } diff --git a/vsaddin/src/IceCsharpConfigurationDialog.cs b/vsaddin/src/IceCsharpConfigurationDialog.cs index 96ef6e6a378..56a2542d031 100755 --- a/vsaddin/src/IceCsharpConfigurationDialog.cs +++ b/vsaddin/src/IceCsharpConfigurationDialog.cs @@ -43,7 +43,8 @@ namespace Ice.VisualStudio { this.Text = "Ice Configuration - Project: " + _project.Name; bool enabled = Util.isSliceBuilderEnabled(project); - _compactFramework = Util.isCSharpSmartDeviceProject(_project); + _compactFramework = Util.isCSharpSmartDeviceProject(_project);
+ _silverlightFramework = Util.isSilverlightProject(_project); setEnabled(enabled); chkEnableBuilder.Checked = enabled; load(); @@ -84,10 +85,16 @@ namespace Ice.VisualStudio { dotNetNames = Util.getDotNetCompactNames(); checkComponent("IceSSL", false); - } - else - { - dotNetNames = Util.getDotNetNames(); + }
+ else if(_silverlightFramework)
+ {
+ dotNetNames = Util.getSilverlightNames();
+ checkComponent("IceSSL", false);
+ checkComponent("IceBox", false);
+ }
+ else
+ {
+ dotNetNames = Util.getDotNetNames();
} foreach(String s in dotNetNames) { @@ -251,15 +258,23 @@ namespace Ice.VisualStudio chkIceGrid.Enabled = enabled; chkIcePatch2.Enabled = enabled; // - // Ice .NET Compact Framework doesn't support SSL + // Ice .NET Compact Framework doesn't support IceSSL // if(_compactFramework) { chkIceSSL.Enabled = false; - } - else - { - chkIceSSL.Enabled = enabled; + }
+ //
+ // Ice Silverlight doesn't support IceSSL and IceBox
+ //
+ else if(_silverlightFramework)
+ {
+ chkIceSSL.Enabled = false;
+ chkIceBox.Enabled = false;
+ }
+ else
+ {
+ chkIceSSL.Enabled = enabled;
} chkIceStorm.Enabled = enabled; @@ -389,10 +404,13 @@ namespace Ice.VisualStudio if(chkGlacier2.Checked) { components.Add("Glacier2"); - } - if(chkIceBox.Checked) - { - components.Add("IceBox"); + }
+ if(!_silverlightFramework)
+ {
+ if (chkIceBox.Checked)
+ {
+ components.Add("IceBox");
+ }
} if(chkIceGrid.Checked) { @@ -402,7 +420,7 @@ namespace Ice.VisualStudio { components.Add("IcePatch2"); } - if(!_compactFramework) + if(!_compactFramework && !_silverlightFramework) { if(chkIceSSL.Checked) { @@ -513,14 +531,17 @@ namespace Ice.VisualStudio { components.Add("Glacier2"); } - } - if(chkIceBox.Checked != Util.hasDotNetReference(_project, "IceBox")) - { - componentChanged("IceBox", chkIceBox.Checked, development); - if(!chkIceBox.Checked) - { - components.Add("IceBox"); - } + }
+ if(!_silverlightFramework)
+ {
+ if (chkIceBox.Checked != Util.hasDotNetReference(_project, "IceBox"))
+ {
+ componentChanged("IceBox", chkIceBox.Checked, development);
+ if (!chkIceBox.Checked)
+ {
+ components.Add("IceBox");
+ }
+ }
} if(chkIceGrid.Checked != Util.hasDotNetReference(_project, "IceGrid")) { @@ -538,7 +559,7 @@ namespace Ice.VisualStudio components.Add("IcePatch2"); } } - if(!_compactFramework) + if(!_compactFramework && !_silverlightFramework) { if(chkIceSSL.Checked != Util.hasDotNetReference(_project, "IceSSL")) { @@ -638,10 +659,13 @@ namespace Ice.VisualStudio if(chkGlacier2.Checked != Util.hasDotNetReference(_project, "Glacier2")) { return true; - } - if(chkIceBox.Checked != Util.hasDotNetReference(_project, "IceBox")) - { - return true; + }
+ if(!_silverlightFramework)
+ {
+ if(chkIceBox.Checked != Util.hasDotNetReference(_project, "IceBox"))
+ {
+ return true;
+ }
} if(chkIceGrid.Checked != Util.hasDotNetReference(_project, "IceGrid")) { @@ -651,7 +675,7 @@ namespace Ice.VisualStudio { return true; } - if(!_compactFramework) + if(!_compactFramework && !_silverlightFramework) { if(chkIceSSL.Checked != Util.hasDotNetReference(_project, "IceSSL")) { @@ -668,6 +692,7 @@ namespace Ice.VisualStudio private bool _initialized; private Project _project; private bool _changed = false; - private bool _compactFramework = false; + private bool _compactFramework = false;
+ private bool _silverlightFramework = false; } } diff --git a/vsaddin/src/IceSilverlightConfigurationDialog.Designer.cs b/vsaddin/src/IceSilverlightConfigurationDialog.Designer.cs deleted file mode 100644 index d09c6b2ac02..00000000000 --- a/vsaddin/src/IceSilverlightConfigurationDialog.Designer.cs +++ /dev/null @@ -1,208 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -namespace Ice.VisualStudio -{ - partial class IceSilverlightConfigurationDialog - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - {
- this.components = new System.ComponentModel.Container();
- this.chkEnableBuilder = new System.Windows.Forms.CheckBox();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.chkIcePrefix = new System.Windows.Forms.CheckBox();
- this.label1 = new System.Windows.Forms.Label();
- this.comboBoxVerboseLevel = new System.Windows.Forms.ComboBox();
- this.btnCancel = new System.Windows.Forms.Button();
- this.toolTip = new System.Windows.Forms.ToolTip(this.components);
- this.btnApply = new System.Windows.Forms.Button();
- this.btnOk = new System.Windows.Forms.Button();
- this.outputDirView = new Ice.VisualStudio.OutputDirView();
- this.includePathView = new Ice.VisualStudio.IncludePathView();
- this.extraCompilerOptions = new Ice.VisualStudio.ExtraCompilerOptionsView();
- this.groupBox4.SuspendLayout();
- this.SuspendLayout();
- //
- // chkEnableBuilder
- //
- this.chkEnableBuilder.AutoSize = true;
- this.chkEnableBuilder.Location = new System.Drawing.Point(4, 10);
- this.chkEnableBuilder.Name = "chkEnableBuilder";
- this.chkEnableBuilder.Size = new System.Drawing.Size(112, 17);
- this.chkEnableBuilder.TabIndex = 0;
- this.chkEnableBuilder.Text = "Enable Ice Builder";
- this.chkEnableBuilder.UseVisualStyleBackColor = true;
- this.chkEnableBuilder.CheckedChanged += new System.EventHandler(this.chkEnableBuilder_CheckedChanged);
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.chkIcePrefix);
- this.groupBox4.Location = new System.Drawing.Point(4, 91);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(487, 44);
- this.groupBox4.TabIndex = 4;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "Slice compiler options";
- //
- // chkIcePrefix
- //
- this.chkIcePrefix.AutoSize = true;
- this.chkIcePrefix.Location = new System.Drawing.Point(10, 19);
- this.chkIcePrefix.Name = "chkIcePrefix";
- this.chkIcePrefix.Size = new System.Drawing.Size(41, 17);
- this.chkIcePrefix.TabIndex = 0;
- this.chkIcePrefix.Text = "Ice";
- this.chkIcePrefix.UseVisualStyleBackColor = true;
- this.chkIcePrefix.CheckedChanged += new System.EventHandler(this.component_Changed);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(289, 12);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(75, 13);
- this.label1.TabIndex = 1;
- this.label1.Text = "Tracing Level:";
- //
- // comboBoxVerboseLevel
- //
- this.comboBoxVerboseLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBoxVerboseLevel.FormattingEnabled = true;
- this.comboBoxVerboseLevel.Items.AddRange(new object[] {
- "Errors Only",
- "Info",
- "Debug"});
- this.comboBoxVerboseLevel.Location = new System.Drawing.Point(370, 8);
- this.comboBoxVerboseLevel.Name = "comboBoxVerboseLevel";
- this.comboBoxVerboseLevel.Size = new System.Drawing.Size(121, 21);
- this.comboBoxVerboseLevel.TabIndex = 2;
- this.comboBoxVerboseLevel.SelectedIndexChanged += new System.EventHandler(this.component_Changed);
- //
- // btnCancel
- //
- this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.btnCancel.Location = new System.Drawing.Point(335, 394);
- this.btnCancel.Name = "btnCancel";
- this.btnCancel.Size = new System.Drawing.Size(75, 23);
- this.btnCancel.TabIndex = 8;
- this.btnCancel.Text = "Cancel";
- this.btnCancel.UseVisualStyleBackColor = true;
- this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
- //
- // btnApply
- //
- this.btnApply.Location = new System.Drawing.Point(416, 394);
- this.btnApply.Name = "btnApply";
- this.btnApply.Size = new System.Drawing.Size(75, 23);
- this.btnApply.TabIndex = 9;
- this.btnApply.Text = "Apply";
- this.btnApply.UseVisualStyleBackColor = true;
- this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
- //
- // btnOk
- //
- this.btnOk.Location = new System.Drawing.Point(254, 394);
- this.btnOk.Name = "btnOk";
- this.btnOk.Size = new System.Drawing.Size(75, 23);
- this.btnOk.TabIndex = 7;
- this.btnOk.Text = "OK";
- this.btnOk.UseVisualStyleBackColor = true;
- this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
- //
- // outputDirView
- //
- this.outputDirView.Location = new System.Drawing.Point(4, 35);
- this.outputDirView.Margin = new System.Windows.Forms.Padding(0);
- this.outputDirView.Name = "outputDirView";
- this.outputDirView.Size = new System.Drawing.Size(487, 48);
- this.outputDirView.TabIndex = 3;
- //
- // includePathView
- //
- this.includePathView.Location = new System.Drawing.Point(4, 219);
- this.includePathView.Name = "includePathView";
- this.includePathView.Size = new System.Drawing.Size(487, 168);
- this.includePathView.TabIndex = 6;
- //
- // extraCompilerOptions
- //
- this.extraCompilerOptions.Location = new System.Drawing.Point(4, 143);
- this.extraCompilerOptions.Name = "extraCompilerOptions";
- this.extraCompilerOptions.Size = new System.Drawing.Size(487, 68);
- this.extraCompilerOptions.TabIndex = 5;
- //
- // IceSilverlightConfigurationDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.btnCancel;
- this.ClientSize = new System.Drawing.Size(494, 426);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.outputDirView);
- this.Controls.Add(this.comboBoxVerboseLevel);
- this.Controls.Add(this.btnOk);
- this.Controls.Add(this.btnApply);
- this.Controls.Add(this.includePathView);
- this.Controls.Add(this.extraCompilerOptions);
- this.Controls.Add(this.btnCancel);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.chkEnableBuilder);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
- this.MaximizeBox = false;
- this.Name = "IceSilverlightConfigurationDialog";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Ice Configuration";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.formClosing);
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- } - - #endregion
-
- private System.Windows.Forms.CheckBox chkEnableBuilder; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.CheckBox chkIcePrefix; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.ToolTip toolTip; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ComboBox comboBoxVerboseLevel; - private ExtraCompilerOptionsView extraCompilerOptions; - private IncludePathView includePathView; - private System.Windows.Forms.Button btnApply; - private System.Windows.Forms.Button btnOk; - private OutputDirView outputDirView; - } -} diff --git a/vsaddin/src/IceSilverlightConfigurationDialog.cs b/vsaddin/src/IceSilverlightConfigurationDialog.cs deleted file mode 100644 index dd875874584..00000000000 --- a/vsaddin/src/IceSilverlightConfigurationDialog.cs +++ /dev/null @@ -1,395 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.IO; -using System.Text; -using System.Windows.Forms; -using System.Globalization; -using EnvDTE; - -namespace Ice.VisualStudio -{ - public partial class IceSilverlightConfigurationDialog : Form, IceConfigurationDialog - { - public IceSilverlightConfigurationDialog(Project project) - { - InitializeComponent(); - _project = project; - - outputDirView.init(this, _project); - extraCompilerOptions.init(this, _project); - includePathView.init(this, _project); - - // - // Set the toolTip messages. - // - toolTip.SetToolTip(chkIcePrefix, "Allow Ice prefix (--ice)."); - - if(_project != null) - { - this.Text = "Ice Configuration - Project: " + _project.Name; - bool enabled = Util.isSliceBuilderEnabled(project); - setEnabled(enabled); - chkEnableBuilder.Checked = enabled; - load(); - _initialized = true; - }
- chkEnableBuilder.Focus(); - } - -#region IceConfigurationDialog interface - - public bool editingIncludeDir() - { - return includePathView.editingIncludeDir(); - } - - public void endEditIncludeDir(bool saveChanges) - { - includePathView.endEditIncludeDir(saveChanges); - } - - public void needSave() - { - if(_initialized) - { - btnApply.Enabled = hasUnsavedChanges(); - } - } - - public void unsetCancelButton() - { - CancelButton = null; - } - - public void setCancelButton() - { - CancelButton = btnCancel; - } - -#endregion IceConfigurationDialog interface - private void load() - { - if(_project == null) - { - return; - } - Cursor = Cursors.WaitCursor; - outputDirView.load(); - extraCompilerOptions.load(); - - chkIcePrefix.Checked = Util.getProjectPropertyAsBool(_project, Util.PropertyIcePrefix); - comboBoxVerboseLevel.SelectedIndex = Util.getVerboseLevel(_project); - - includePathView.load(); - - btnApply.Enabled = false; - Cursor = Cursors.Default; - } - - private void chkEnableBuilder_CheckedChanged(object sender, EventArgs e) - { - try - { - Cursor = Cursors.WaitCursor; - if(editingIncludeDir()) - { - endEditIncludeDir(true); - } - if(_initialized) - { - _initialized = false; - setEnabled(chkEnableBuilder.Checked); - - ComponentList components; - if(chkEnableBuilder.Checked) - { - // - // Enable the components that were previously enabled, if any. - // - components = new ComponentList(Util.getProjectProperty(_project, Util.PropertyIceComponents)); - - // - // If there isn't a previous set of components, we enable the default components. - // - if(components.Count == 0) - { - components.Add("IceSL"); - } - } - else - { - components = new ComponentList("IceSL"); - } - - - chkEnableBuilder.Enabled = true; - _initialized = true; - needSave(); - } - Cursor = Cursors.Default; - } - catch(Exception ex) - { - Cursor = Cursors.Default; - Util.unexpectedExceptionWarning(ex); - throw; - } - } - - private void setEnabled(bool enabled) - { - outputDirView.setEnabled(enabled); - chkIcePrefix.Enabled = enabled; - comboBoxVerboseLevel.Enabled = enabled; - extraCompilerOptions.setEnabled(enabled); - includePathView.setEnabled(enabled); - } - - private void formClosing(object sender, FormClosingEventArgs e) - { - try - { - if(editingIncludeDir()) - { - endEditIncludeDir(false); - } - - if(hasUnsavedChanges()) - { - if(!Util.warnUnsavedChanges(this)) - { - e.Cancel = true; - return; - } - } - - Cursor = Cursors.WaitCursor; - if(_changed && Util.isSliceBuilderEnabled(_project)) - { - Util.rebuildProject(_project); - } - Cursor = Cursors.Default; - } - catch(Exception ex) - { - Cursor = Cursors.Default; - Util.unexpectedExceptionWarning(ex); - throw; - } - } - - private void btnCancel_Click(object sender, EventArgs e) - { - try - { - Close(); - } - catch(Exception ex) - { - Util.unexpectedExceptionWarning(ex); - throw; - } - } - - private void component_Changed(object sender, EventArgs e) - { - try - { - Cursor = Cursors.WaitCursor; - if(editingIncludeDir()) - { - endEditIncludeDir(true); - } - needSave(); - Cursor = Cursors.Default; - } - catch(Exception ex) - { - Cursor = Cursors.Default; - Util.unexpectedExceptionWarning(ex); - throw; - } - } - - // - // Apply unsaved changes, returns true if new settings are all applied correctly, - // otherwise returns false. - // - private bool apply() - { - if(!hasUnsavedChanges()) - { - return true; // Nothing to do. - } - - try - { - if(editingIncludeDir()) - { - endEditIncludeDir(true); - } - - // - // This must be the first setting to be updated, as other settings cannot be - // updated if the add-in is disabled. - // - if(chkEnableBuilder.Checked && !Util.isSliceBuilderEnabled(_project)) - { - Util.addBuilderToProject(_project, new ComponentList(Util.getSilverlightNames())); - _changed = true; - } - - bool changed = false; - if(!outputDirView.apply(ref changed)) - { - return false; - } - if(changed) - { - _changed = true; - } - - if(chkIcePrefix.Checked != Util.getProjectPropertyAsBool(_project, Util.PropertyIcePrefix)) - { - Util.setProjectProperty(_project, Util.PropertyIcePrefix, chkIcePrefix.Checked.ToString()); - _changed = true; - } - - if(comboBoxVerboseLevel.SelectedIndex != Util.getVerboseLevel(_project)) - { - Util.setProjectProperty(_project, Util.PropertyVerboseLevel, - comboBoxVerboseLevel.SelectedIndex.ToString(CultureInfo.InvariantCulture)); - _changed = true; - } - - changed = false; - if(!extraCompilerOptions.apply(ref changed)) - { - return false; - } - if(changed) - { - _changed = true; - } - - if(includePathView.apply()) - { - _changed = true; - } - - // - // This must be the last setting to be updated, as we want to update - // all other settings and that isn't possible if the builder is disabled. - // - if(!chkEnableBuilder.Checked && Util.isSliceBuilderEnabled(_project)) - { - Util.removeBuilderFromProject(_project, new ComponentList()); - _initialized = false; - load(); - _initialized = true; - _changed = true; - } - - return true; - } - finally - { - needSave(); // Call needSave to update apply button status - } - } - - private bool hasUnsavedChanges() - { - if(chkEnableBuilder.Checked != Util.isSliceBuilderEnabled(_project)) - { - return true; - } - - // - // If the builder is disabled, we are not interested in the other settings - // to compute changes. - // - if(!Util.isSliceBuilderEnabled(_project)) - { - return false; - } - - if(outputDirView.hasUnsavedChanges()) - { - return true; - } - - if(chkIcePrefix.Checked != Util.getProjectPropertyAsBool(_project, Util.PropertyIcePrefix)) - { - return true; - } - - if(comboBoxVerboseLevel.SelectedIndex != Util.getVerboseLevel(_project)) - { - return true; - } - - if(extraCompilerOptions.hasUnsavedChanges()) - { - return true; - } - - if(includePathView.hasUnsavedChanges()) - { - return true; - } - return false; - } - - private void btnOk_Click(object sender, EventArgs e) - { - try - { - Cursor = Cursors.WaitCursor; - if(apply()) - { - Close(); - } - Cursor = Cursors.Default; - } - catch(Exception ex) - { - Cursor = Cursors.Default; - Util.unexpectedExceptionWarning(ex); - throw; - } - } - - private void btnApply_Click(object sender, EventArgs e) - { - try - { - Cursor = Cursors.WaitCursor; - apply(); - Cursor = Cursors.Default; - } - catch(Exception ex) - { - Cursor = Cursors.Default; - Util.unexpectedExceptionWarning(ex); - throw; - } - } - - private bool _initialized; - private bool _changed; - private Project _project; - } -} diff --git a/vsaddin/src/IceSilverlightConfigurationDialog.resx b/vsaddin/src/IceSilverlightConfigurationDialog.resx deleted file mode 100644 index a5979aadfff..00000000000 --- a/vsaddin/src/IceSilverlightConfigurationDialog.resx +++ /dev/null @@ -1,123 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
-</root>
\ No newline at end of file diff --git a/vsaddin/src/Util.cs b/vsaddin/src/Util.cs index 2f5f7e6cac0..083b9adc70e 100644 --- a/vsaddin/src/Util.cs +++ b/vsaddin/src/Util.cs @@ -294,7 +294,6 @@ namespace Ice.VisualStudio public const string slice2cs = "slice2cs.exe";
public const string slice2cpp = "slice2cpp.exe";
- public const string slice2sl = "slice2sl.exe";
//
// Property names used to persist project configuration.
@@ -315,7 +314,8 @@ namespace Ice.VisualStudio private static readonly string[] silverlightNames =
{
- "IceSL"
+ "Glacier2", "Ice", "IceGrid", "IcePatch2",
+ "IceStorm"
};
public static string[] getSilverlightNames()
@@ -356,15 +356,6 @@ namespace Ice.VisualStudio return (string[])dotNetNames.Clone();
}
- public static string getIceSlHome()
- {
- //
- // For Silverlight projects Ice Home is always set to the value of ICE_SL_HOME
- // environment variable.
- //
- return Environment.ExpandEnvironmentVariables("%ICE_SL_HOME%");
- }
-
public static string getIceHome()
{
string defaultIceHome = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
@@ -473,6 +464,10 @@ namespace Ice.VisualStudio {
binDir = _csCompactFrameworkBinDirs;
}
+ else if(isSilverlightProject(project))
+ {
+ binDir = _slBinDirs;
+ }
else
{
binDir = _csBinDirs;
@@ -630,6 +625,7 @@ namespace Ice.VisualStudio private static readonly string _csBinDirs = "\\bin\\";
private static readonly string _csCompactFrameworkBinDirs = "\\bin\\cf\\";
+ private static readonly string _slBinDirs = "\\bin\\sl\\";
public static bool addDotNetReference(Project project, string component, string iceHome, bool development)
{
@@ -643,6 +639,10 @@ namespace Ice.VisualStudio {
csBinDir = _csCompactFrameworkBinDirs;
}
+ else if (isSilverlightProject(project))
+ {
+ csBinDir = _slBinDirs;
+ }
else
{
csBinDir = _csBinDirs;
@@ -650,7 +650,7 @@ namespace Ice.VisualStudio string reference = iceHome + csBinDir + component + ".dll";
- if (File.Exists(reference))
+ if(File.Exists(reference))
{
VSLangProj.VSProject vsProject = (VSLangProj.VSProject)project.Object;
try
@@ -2153,6 +2153,10 @@ namespace Ice.VisualStudio {
componentNames = getDotNetCompactNames();
}
+ else if (Util.isSilverlightProject(project))
+ {
+ componentNames = getSilverlightNames();
+ }
else
{
componentNames = getDotNetNames();
@@ -2568,12 +2572,6 @@ namespace Ice.VisualStudio string binDir = getCsBinDir(project);
ComponentList components = Util.getIceDotNetComponents(project);
- if(isSilverlightProject(project))
- {
- iceHome = getIceSlHome();
- components = Util.getIceSilverlightComponents(project);
- }
-
foreach(string component in components)
{
if (String.IsNullOrEmpty(component))
@@ -2833,46 +2831,6 @@ namespace Ice.VisualStudio }
}
- public static bool parseSlice2slOptions(string args, bool showWarning, ref Options opts)
- {
- try
- {
- opts = null;
-
- if(String.IsNullOrEmpty(args))
- {
- return true; //No options to parse
- }
-
- opts = new Options();
- opts.addOpt("h", "help");
- opts.addOpt("v", "version");
- opts.addOpt("D", "", Options.ArgType.NeedArg, "", Options.RepeatType.Repeat);
- opts.addOpt("U", "", Options.ArgType.NeedArg, "", Options.RepeatType.Repeat);
- opts.addOpt("I", "", Options.ArgType.NeedArg, "", Options.RepeatType.Repeat);
- opts.addOpt("E");
- opts.addOpt("", "output-dir", Options.ArgType.NeedArg);
- opts.addOpt("", "depend");
- opts.addOpt("d", "debug");
- opts.addOpt("", "ice");
- opts.addOpt("", "case-sensitive");
-
- opts.parse(Options.split(args));
-
- checkInvalidOptions(opts);
-
- return true;
- }
- catch(BadOptionException ex)
- {
- if(showWarning)
- {
- showExtraOptionsWarning(ex);
- }
- return false;
- }
- }
-
public static bool parseSlice2csOptions(string args, bool showWarning, ref Options opts)
{
try
diff --git a/vsaddin/src/addin-vs2008.csproj b/vsaddin/src/addin-vs2008.csproj index 75fb93f0c5e..da095d3ba67 100755 --- a/vsaddin/src/addin-vs2008.csproj +++ b/vsaddin/src/addin-vs2008.csproj @@ -2,7 +2,7 @@ <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DB79C06D-CC17-4B29-B4BE-EAE5C8FED3E5}</ProjectGuid>
<OutputType>Library</OutputType>
@@ -107,12 +107,6 @@ <Compile Include="IceCsharpConfigurationDialog.Designer.cs">
<DependentUpon>IceCsharpConfigurationDialog.cs</DependentUpon>
</Compile>
- <Compile Include="IceSilverlightConfigurationDialog.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="IceSilverlightConfigurationDialog.designer.cs">
- <DependentUpon>IceSilverlightConfigurationDialog.cs</DependentUpon>
- </Compile>
<Compile Include="IncludePathView.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -175,9 +169,6 @@ <EmbeddedResource Include="IceCsharpConfigurationDialog.resx">
<DependentUpon>IceCsharpConfigurationDialog.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="IceSilverlightConfigurationDialog.resx">
- <DependentUpon>IceSilverlightConfigurationDialog.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="IncludePathView.resx">
<DependentUpon>IncludePathView.cs</DependentUpon>
</EmbeddedResource>
diff --git a/vsaddin/src/addin-vs2010.csproj b/vsaddin/src/addin-vs2010.csproj index 1f01d8eee00..6426060c9ae 100755 --- a/vsaddin/src/addin-vs2010.csproj +++ b/vsaddin/src/addin-vs2010.csproj @@ -140,12 +140,6 @@ <Compile Include="IceCsharpConfigurationDialog.Designer.cs">
<DependentUpon>IceCsharpConfigurationDialog.cs</DependentUpon>
</Compile>
- <Compile Include="IceSilverlightConfigurationDialog.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="IceSilverlightConfigurationDialog.designer.cs">
- <DependentUpon>IceSilverlightConfigurationDialog.cs</DependentUpon>
- </Compile>
<Compile Include="IncludePathView.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -208,9 +202,6 @@ <EmbeddedResource Include="IceCsharpConfigurationDialog.resx">
<DependentUpon>IceCsharpConfigurationDialog.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="IceSilverlightConfigurationDialog.resx">
- <DependentUpon>IceSilverlightConfigurationDialog.cs</DependentUpon>
- </EmbeddedResource>
<EmbeddedResource Include="IncludePathView.resx">
<DependentUpon>IncludePathView.cs</DependentUpon>
</EmbeddedResource>
|