aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-04-11 16:07:21 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-04-11 16:07:21 +0300
commitb41347f1528e5e34d8c8c8ef2c5b6b63876098f1 (patch)
tree79f83df85407f02bad7b025030c7c79a3aca1439
parent50672cf57739bac3c0ddefcd40563d0fbed3db80 (diff)
downloadTango-b41347f1528e5e34d8c8c8ef2c5b6b63876098f1.tar.gz
Tango-b41347f1528e5e34d8c8c8ef2c5b6b63876098f1.zip
added icons to menu, solution for setting icons dynamically to context menu
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/App.config44
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj2
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Converters/BitmapSourceToImageConverter.cs31
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Open_16x.pngbin0 -> 452 bytes
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Rename_16x.pngbin0 -> 210 bytes
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Settings_Inverse_16x.pngbin0 -> 405 bytes
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/copy_16x.pngbin0 -> 245 bytes
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/deletered_16.pngbin0 -> 621 bytes
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/hashtag.pngbin0 -> 386 bytes
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Project.cs8
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs10
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml9
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs12
-rw-r--r--Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj19
-rw-r--r--Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.pngbin0 -> 575 bytes
15 files changed, 75 insertions, 60 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/App.config b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/App.config
index de2319b52..aa58e3cac 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/App.config
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/App.config
@@ -6,50 +6,6 @@
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
- </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj
index e4702273a..deda62b7c 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE.UI/Tango.Scripting.IDE.UI.csproj
@@ -12,7 +12,7 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
- <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+ <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Converters/BitmapSourceToImageConverter.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Converters/BitmapSourceToImageConverter.cs
new file mode 100644
index 000000000..c7cd1e573
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Converters/BitmapSourceToImageConverter.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+
+namespace Tango.Scripting.IDE.Converters
+{
+ public class BitmapSourceToImageConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return new Image()
+ {
+ Source = value as BitmapSource,
+ Width = 16,
+ Height = 16,
+ };
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Open_16x.png b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Open_16x.png
new file mode 100644
index 000000000..88cfc578a
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Open_16x.png
Binary files differ
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Rename_16x.png b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Rename_16x.png
new file mode 100644
index 000000000..eb85c52a8
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Rename_16x.png
Binary files differ
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Settings_Inverse_16x.png b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Settings_Inverse_16x.png
new file mode 100644
index 000000000..464a9f751
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/Settings_Inverse_16x.png
Binary files differ
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/copy_16x.png b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/copy_16x.png
new file mode 100644
index 000000000..7f3de9d64
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/copy_16x.png
Binary files differ
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/deletered_16.png b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/deletered_16.png
new file mode 100644
index 000000000..35b767569
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/deletered_16.png
Binary files differ
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/hashtag.png b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/hashtag.png
new file mode 100644
index 000000000..74c6d1801
--- /dev/null
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Images/hashtag.png
Binary files differ
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Project.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Project.cs
index 9ba1ed902..6392ddcb7 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Project.cs
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Project.cs
@@ -38,10 +38,10 @@ namespace Tango.Scripting.IDE
Commands = new ObservableCollection<ISolutionItemCommand>
{
new SolutionItemCommand(BuildProject) { Name = "Build", Image= GetImage(@"Images/BuildSolution_16x.png") },
- new SolutionItemCommand(SetStartUpProject) { Name = "Set as StartUp Project" },
- new SolutionItemCommand(Remove) { Name = "Remove" },
- new SolutionItemCommand(Rename) { Name = "Rename" },
- new SolutionItemCommand(OpenFolderInFileExplorer) { Name = "Open Folder In File Explorer" },
+ new SolutionItemCommand(SetStartUpProject) { Name = "Set as StartUp Project" , Image= GetImage(@"Images/Settings_Inverse_16x.png")},
+ new SolutionItemCommand(Remove) { Name = "Remove" , Image= GetImage(@"Images/deletered_16.png")},
+ new SolutionItemCommand(Rename) { Name = "Rename", Image= GetImage(@"Images/Rename_16x.png") },
+ new SolutionItemCommand(OpenFolderInFileExplorer) { Name = "Open Folder In File Explorer", Image= GetImage(@"Images/Open_16x.png") },
new SolutionItemCommand()
{
Name = "Add...",
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs
index e53f90ef3..0fe375a1f 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ProjectItems/CSharpScriptItem.cs
@@ -11,7 +11,7 @@ namespace Tango.Scripting.IDE.ProjectItems
{
public class CSharpScriptItem : ProjectItem
{
- public override BitmapSource Image => GetImage("Images/CSharpScriptItem.png");
+ public override BitmapSource Image => GetImage("Images/hashtag.png");
private String _code;
public String Code
@@ -31,11 +31,11 @@ namespace Tango.Scripting.IDE.ProjectItems
{
Commands = new System.Collections.ObjectModel.ObservableCollection<ISolutionItemCommand>()
{
- new SolutionItemCommand(Open) { Name = "Open" },
+ new SolutionItemCommand(Open) { Name = "Open" , Image = GetImage(@"Images/Open_16x.png")},
new SolutionItemCommand(CutItem) { Name = "Cut" , Image = GetImage(@"Images/Cut_16xSM.png")},
- new SolutionItemCommand(CopyItem) { Name = "Copy" },
- new SolutionItemCommand(CopyItem) { Name = "Delete" },
- new SolutionItemCommand(RenameItem) { Name = "Rename" }
+ new SolutionItemCommand(CopyItem) { Name = "Copy" , Image = GetImage(@"Images/copy_16x.png")},
+ new SolutionItemCommand(CopyItem) { Name = "Delete" , Image = GetImage(@"Images/deletered_16.png")},
+ new SolutionItemCommand(RenameItem) { Name = "Rename", Image = GetImage(@"Images/Rename_16x.png") }
};
}
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml
index 6f3914ec8..e79734b3a 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/ScriptIDEView2.xaml
@@ -6,6 +6,7 @@
xmlns:local="clr-namespace:Tango.Scripting.IDE"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:controls="clr-namespace:Tango.Scripting.IDE.Controls"
+ xmlns:converters="clr-namespace:Tango.Scripting.IDE.Converters"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=local:ScriptIDEViewVM, IsDesignTimeCreatable=False}" x:Name="control">
<UserControl.Resources>
@@ -15,15 +16,13 @@
<ResourceDictionary Source="Themes/Shared.xaml"/>
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BoolToVis" />
+ <converters:BitmapSourceToImageConverter x:Key="BitmapSourceToImageConverter" />
+
<Style x:Key="ContentMmenuItemStyle" TargetType="MenuItem">
<Setter Property="Command" Value="{Binding}"/>
<Setter Property="Header" Value="{Binding Name}"/>
<Setter Property="ItemsSource" Value="{Binding Commands}"/>
- <Setter Property="Icon">
- <Setter.Value>
- <Image Source="{Binding Image}" Height="12" Width="12"/>
- </Setter.Value>
- </Setter>
+ <Setter Property="Icon" Value="{Binding Image,Converter={StaticResource BitmapSourceToImageConverter}}"></Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs
index c6627d354..9fbac01c2 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/SolutionItemCommand.cs
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.IO;
using System.Linq;
using System.Text;
@@ -10,7 +12,7 @@ using Tango.Core.Commands;
namespace Tango.Scripting.IDE
{
- public class SolutionItemCommand : RelayCommand, ISolutionItemCommand
+ public class SolutionItemCommand : RelayCommand, ISolutionItemCommand, INotifyPropertyChanged
{
public SolutionItemCommand() : base(()=> { })
{
@@ -53,6 +55,9 @@ namespace Tango.Scripting.IDE
public String Name { get; set; }
BitmapSource _bImage;
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
public BitmapSource Image {
get
{
@@ -61,9 +66,14 @@ namespace Tango.Scripting.IDE
set
{
_bImage = value;
+ RaisePropertyChanged(nameof(Image));
}
}
public ObservableCollection<ISolutionItemCommand> Commands { get; set; }
+ protected virtual void RaisePropertyChanged(String propName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
+ }
}
}
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj
index 194f49ea8..4f47db2bc 100644
--- a/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj
+++ b/Software/Visual_Studio/Scripting/Tango.Scripting.IDE/Tango.Scripting.IDE.csproj
@@ -75,6 +75,7 @@
<Compile Include="Controls\SharedResourceDictionary.cs" />
<Compile Include="Controls\SolutionItemControl.cs" />
<Compile Include="Controls\TabConrolClose.cs" />
+ <Compile Include="Converters\BitmapSourceToImageConverter.cs" />
<Compile Include="Converters\LeftMarginMultiplierConverter.cs" />
<Compile Include="Dialogs\NewProjectView.xaml.cs">
<DependentUpon>NewProjectView.xaml</DependentUpon>
@@ -315,5 +316,23 @@
<ItemGroup>
<Resource Include="Images\jigsaw.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\hashtag.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\copy_16x.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Open_16x.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Settings_Inverse_16x.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\deletered_16.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Rename_16x.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.png b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.png
new file mode 100644
index 000000000..869ae3797
--- /dev/null
+++ b/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Images/deletered_16.png
Binary files differ