diff --git a/SharpDevelop.sln b/SharpDevelop.sln
index 08a82ab1b0..5462734ca0 100644
--- a/SharpDevelop.sln
+++ b/SharpDevelop.sln
@@ -107,6 +107,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HexEditor", "src\AddIns\Dis
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "src\AddIns\DisplayBindings\XmlEditor\Project\XmlEditor.csproj", "{DCA2703D-250A-463E-A68A-07ED105AE6BD}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IconEditorAddIn", "src\AddIns\DisplayBindings\IconEditor\IconEditorAddIn.csproj", "{DFB936AD-90EE-4B4F-941E-4F4A636F0D92}"
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Analysis", "Analysis", "{7019F43E-DFD7-4D1C-8C96-E75D55646DE7}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@@ -435,6 +437,14 @@ Global
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C}.Release|x86.Build.0 = Release|Any CPU
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C}.Release|x86.ActiveCfg = Release|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Debug|x86.Build.0 = Debug|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Release|x86.Build.0 = Release|Any CPU
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -482,6 +492,7 @@ Global
{0162E499-42D0-409B-AA25-EED21F75336B} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
{E618A9CD-A39F-4925-A538-E8A3FEF24E54} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
{DCA2703D-250A-463E-A68A-07ED105AE6BD} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
+ {DFB936AD-90EE-4B4F-941E-4F4A636F0D92} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
{1F261725-6318-4434-A1B1-6C70CE4CD324} = {7019F43E-DFD7-4D1C-8C96-E75D55646DE7}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E}
diff --git a/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluator.cs b/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluator.cs
deleted file mode 100644
index 2353256cab..0000000000
--- a/src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluator.cs
+++ /dev/null
@@ -1,967 +0,0 @@
-// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
-// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Text;
-using Debugger;
-using Debugger.MetaData;
-using ICSharpCode.NRefactory.Ast;
-using ICSharpCode.SharpDevelop.Services;
-
-namespace ICSharpCode.NRefactory.Visitors
-{
- public class EvaluateException: GetValueException
- {
- public EvaluateException(INode code, string msg):base(msg) {}
- public EvaluateException(INode code, string msgFmt, params string[] msgArgs):base(string.Format(msgFmt, msgArgs)) {}
- }
-
- class TypedValue
- {
- Value value;
- DebugType type;
-
- public Value Value {
- get { return value; }
- }
-
- public DebugType Type {
- get { return type; }
- }
-
- public object PrimitiveValue {
- get { return value.PrimitiveValue; }
- }
-
- public TypedValue(Value value, DebugType type)
- {
- this.value = value;
- this.type = type;
- }
- }
-
- public class ExpressionEvaluator: NotImplementedAstVisitor
- {
- StackFrame context;
-
- public StackFrame Context {
- get { return context; }
- }
-
- public Thread EvalThread {
- get { return this.Context.Thread; }
- }
-
- ExpressionEvaluator(StackFrame context)
- {
- this.context = context;
- }
-
- public static INode Parse(string code, SupportedLanguage language)
- {
- SnippetParser parser = new SnippetParser(language);
- INode astRoot = parser.Parse(code);
- if (parser.Errors.Count > 0) {
- throw new GetValueException(parser.Errors.ErrorOutput);
- }
- if (parser.SnippetType != SnippetType.Expression && parser.SnippetType != SnippetType.Statements) {
- throw new GetValueException("Code must be expression or statement");
- }
- return astRoot;
- }
-
- /// Evaluate given expression. If you have expression tree already, use overloads of this method.
- /// Returned value or null for statements
- public static Value Evaluate(string code, SupportedLanguage language, StackFrame context, object data = null)
- {
- return Evaluate(Parse(code, language), context, data);
- }
-
- public static Value Evaluate(INode code, StackFrame context, object data = null)
- {
- if (context == null)
- throw new GetValueException("Invalid stackframe");
- if (context.IsInvalid)
- throw new DebuggerException("The context is no longer valid");
-
- TypedValue val = new ExpressionEvaluator(context).Evaluate(code, false, data);
- if (val == null)
- return null;
- return val.Value;
- }
-
- ///
- /// Parses string representation of an expression (eg. "a.b[10] + 2") into NRefactory Expression tree.
- ///
- public static Expression ParseExpression(string code, SupportedLanguage language)
- {
- SnippetParser parser = new SnippetParser(language);
- INode astRoot = parser.Parse(code);
- if (parser.Errors.Count > 0) {
- throw new GetValueException(parser.Errors.ErrorOutput);
- }
- Expression astExpression = astRoot as Expression;
- if (astExpression == null) {
- throw new GetValueException("Code must be expression");
- }
- return astExpression;
- }
-
-
-
- TypedValue Evaluate(INode expression)
- {
- return Evaluate(expression, true);
- }
-
- TypedValue Evaluate(INode expression, bool permRef, object data = null)
- {
- TypedValue val;
-
- System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
- watch.Start();
- try {
- val = (TypedValue)expression.AcceptVisitor(this, data);
- if (val != null && permRef)
- val = new TypedValue(val.Value.GetPermanentReference(this.EvalThread), val.Type);
- } catch (NotImplementedException e) {
- throw new EvaluateException(expression, "Language feature not implemented: " + e.Message);
- } finally {
- watch.Stop();
- context.Process.TraceMessage("Evaluated: {0} in {1} ms total", expression.PrettyPrint(), watch.ElapsedMilliseconds);
- }
-
- if (val != null && val.Value.IsInvalid)
- throw new DebuggerException("Expression \"" + expression.PrettyPrint() + "\" is invalid right after evaluation");
-
- return val;
- }
-
- List EvaluateAll(List exprs)
- {
- List vals = new List(exprs.Count);
- foreach(Expression expr in exprs) {
- vals.Add(Evaluate(expr));
- }
- return vals;
- }
-
- int EvaluateAsInt(INode expression)
- {
- if (expression is PrimitiveExpression) {
- int? i = ((PrimitiveExpression)expression).Value as int?;
- if (i == null)
- throw new EvaluateException(expression, "Integer expected");
- return i.Value;
- } else {
- TypedValue typedVal = Evaluate(expression);
- if (typedVal.Type.CanImplicitelyConvertTo(typeof(int))) {
- int i = (int)Convert.ChangeType(typedVal.PrimitiveValue, typeof(int));
- return i;
- } else {
- throw new EvaluateException(expression, "Integer expected");
- }
- }
- }
-
- TypedValue EvaluateAs(INode expression, DebugType type)
- {
- TypedValue val = Evaluate(expression);
- if (val.Type == type)
- return val;
- if (!val.Type.CanImplicitelyConvertTo(type))
- throw new EvaluateException(expression, "Can not implicitely cast {0} to {1}", val.Type.FullName, type.FullName);
- if (type.IsPrimitive) {
- object oldVal = val.PrimitiveValue;
- object newVal;
- try {
- newVal = Convert.ChangeType(oldVal, type.PrimitiveType);
- } catch (InvalidCastException) {
- throw new EvaluateException(expression, "Can not cast {0} to {1}", val.GetType().FullName, type.FullName);
- } catch (OverflowException) {
- throw new EvaluateException(expression, "Overflow");
- }
- return CreateValue(newVal);
- } else {
- return new TypedValue(val.Value, type);
- }
- }
-
- Value[] GetValues(List typedVals)
- {
- List vals = new List(typedVals.Count);
- foreach(TypedValue typedVal in typedVals) {
- vals.Add(typedVal.Value);
- }
- return vals.ToArray();
- }
-
- DebugType[] GetTypes(List typedVals)
- {
- List types = new List(typedVals.Count);
- foreach(TypedValue typedVal in typedVals) {
- types.Add(typedVal.Type);
- }
- return types.ToArray();
- }
-
- TypedValue CreateValue(object primitiveValue)
- {
- Value val = Eval.CreateValue(this.EvalThread, primitiveValue);
- return new TypedValue(val, val.Type);
- }
-
- public override object VisitAssignmentExpression(AssignmentExpression assignmentExpression, object data)
- {
- BinaryOperatorType op;
- switch (assignmentExpression.Op) {
- case AssignmentOperatorType.Assign: op = BinaryOperatorType.None; break;
- case AssignmentOperatorType.Add: op = BinaryOperatorType.Add; break;
- case AssignmentOperatorType.ConcatString: op = BinaryOperatorType.Concat; break;
- case AssignmentOperatorType.Subtract: op = BinaryOperatorType.Subtract; break;
- case AssignmentOperatorType.Multiply: op = BinaryOperatorType.Multiply; break;
- case AssignmentOperatorType.Divide: op = BinaryOperatorType.Divide; break;
- case AssignmentOperatorType.DivideInteger: op = BinaryOperatorType.DivideInteger; break;
- case AssignmentOperatorType.ShiftLeft: op = BinaryOperatorType.ShiftLeft; break;
- case AssignmentOperatorType.ShiftRight: op = BinaryOperatorType.ShiftRight; break;
- case AssignmentOperatorType.ExclusiveOr: op = BinaryOperatorType.ExclusiveOr; break;
- case AssignmentOperatorType.Modulus: op = BinaryOperatorType.Modulus; break;
- case AssignmentOperatorType.BitwiseAnd: op = BinaryOperatorType.BitwiseAnd; break;
- case AssignmentOperatorType.BitwiseOr: op = BinaryOperatorType.BitwiseOr; break;
- case AssignmentOperatorType.Power: op = BinaryOperatorType.Power; break;
- default: throw new GetValueException("Unknown operator " + assignmentExpression.Op);
- }
-
- TypedValue right;
- if (op == BinaryOperatorType.None) {
- right = Evaluate(assignmentExpression.Right);
- } else {
- BinaryOperatorExpression binOpExpr = new BinaryOperatorExpression();
- binOpExpr.Left = assignmentExpression.Left;
- binOpExpr.Op = op;
- binOpExpr.Right = assignmentExpression.Right;
- right = Evaluate(binOpExpr);
- }
-
- // We can not have perfRef because we need to be able to set the value
- TypedValue left = (TypedValue)assignmentExpression.Left.AcceptVisitor(this, null);
-
- if (left == null) {
- // Can this happen?
- throw new GetValueException(string.Format("\"{0}\" can not be set", assignmentExpression.Left.PrettyPrint()));
- }
- if (!left.Value.IsReference && left.Type.FullName != right.Type.FullName) {
- throw new GetValueException(string.Format("Type {0} expected, {1} seen", left.Type.FullName, right.Type.FullName));
- }
- left.Value.SetValue(this.EvalThread, right.Value);
- return right;
- }
-
- public override object VisitBlockStatement(BlockStatement blockStatement, object data)
- {
- foreach(INode statement in blockStatement.Children) {
- Evaluate(statement);
- }
- return null;
- }
-
- public override object VisitEmptyStatement(EmptyStatement emptyStatement, object data)
- {
- return null;
- }
-
- public override object VisitExpressionStatement(ExpressionStatement expressionStatement, object data)
- {
- Evaluate(expressionStatement.Expression);
- return null;
- }
-
- public override object VisitCastExpression(CastExpression castExpression, object data)
- {
- TypedValue val = Evaluate(castExpression.Expression);
- DebugType castTo = null;
- try {
- castTo = castExpression.CastTo.ResolveType(context.AppDomain);
- } catch (GetValueException) {
- var typeRef = castExpression.CastTo.Clone();
- typeRef.Type = typeRef.Type.Insert(0, context.MethodInfo.DeclaringType.Namespace + ".");
- castTo = typeRef.ResolveType(context.AppDomain);
- }
- if (castTo.IsPrimitive && val.Type.IsPrimitive && castTo != val.Type) {
- object oldVal = val.PrimitiveValue;
- object newVal;
- try {
- newVal = Convert.ChangeType(oldVal, castTo.PrimitiveType);
- } catch (InvalidCastException) {
- throw new EvaluateException(castExpression, "Can not cast {0} to {1}", val.Type.FullName, castTo.FullName);
- } catch (OverflowException) {
- throw new EvaluateException(castExpression, "Overflow");
- }
- val = CreateValue(newVal);
- }
- if (!castTo.IsAssignableFrom(val.Value.Type) && !val.Value.IsNull)
- throw new GetValueException("Can not cast {0} to {1}", val.Value.Type.FullName, castTo.FullName);
- return new TypedValue(val.Value, castTo);
- }
-
- public override object VisitIdentifierExpression(IdentifierExpression identifierExpression, object data)
- {
- string identifier = identifierExpression.Identifier;
-
- DebugParameterInfo par = context.MethodInfo.GetParameter(identifier);
- if (par != null)
- return new TypedValue(par.GetValue(context), (DebugType)par.ParameterType);
-
- DebugLocalVariableInfo loc = context.MethodInfo.GetLocalVariable(context.IP, identifier);
- if (loc != null)
- return new TypedValue(loc.GetValue(context), (DebugType)loc.LocalType);
-
- // try get local var from external information - data or UserData
- int[] localIndex = (data ?? identifierExpression.UserData) as int[];
-
- if (localIndex != null) {
- Value localValue = DebugMethodInfo.GetLocalVariableValue(context, localIndex[0]);
- return new TypedValue(localValue, localValue.Type);
- }
-
- // Instance class members
- // Note that the method might be generated instance method that represents anonymous method
- TypedValue thisValue = GetThisValue();
- if (thisValue != null) {
- IDebugMemberInfo instMember = (IDebugMemberInfo)thisValue.Type.GetMember(identifier, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, DebugType.IsFieldOrNonIndexedProperty);
- if (instMember != null)
- return new TypedValue(Value.GetMemberValue(this.EvalThread, thisValue.Value, (MemberInfo)instMember), instMember.MemberType);
- }
-
- // Static class members
- foreach(DebugType declaringType in ((DebugType)context.MethodInfo.DeclaringType).GetSelfAndDeclaringTypes()) {
- IDebugMemberInfo statMember = (IDebugMemberInfo)declaringType.GetMember(identifier, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static, DebugType.IsFieldOrNonIndexedProperty);
- if (statMember != null)
- return new TypedValue(Value.GetMemberValue(this.EvalThread, null, (MemberInfo)statMember), statMember.MemberType);
- }
-
- throw new GetValueException("Identifier \"" + identifier + "\" not found in this context");
- }
-
- public override object VisitIndexerExpression(IndexerExpression indexerExpression, object data)
- {
- TypedValue target = Evaluate(indexerExpression.TargetObject);
-
- if (target.Type.IsArray) {
- List intIndexes = new List();
- foreach(Expression indexExpr in indexerExpression.Indexes) {
- intIndexes.Add(EvaluateAsInt(indexExpr));
- }
- return new TypedValue(
- target.Value.GetArrayElement(intIndexes.ToArray()),
- (DebugType)target.Type.GetElementType()
- );
- } else if (target.Type.FullName == typeof(string).FullName) {
- if (indexerExpression.Indexes.Count != 1)
- throw new GetValueException("Single index expected");
-
- int index = EvaluateAsInt(indexerExpression.Indexes[0]);
- string str = (string)target.PrimitiveValue;
- if (index < 0 || index >= str.Length)
- throw new GetValueException("Index was outside the bounds of the array.");
- return CreateValue(str[index]);
- } else {
- List indexes = EvaluateAll(indexerExpression.Indexes);
- DebugPropertyInfo pi = (DebugPropertyInfo)target.Type.GetProperty("Item", GetTypes(indexes));
- if (pi == null)
- throw new GetValueException("The object does not have an indexer property");
- return new TypedValue(
- target.Value.GetPropertyValue(this.EvalThread, pi, GetValues(indexes)),
- (DebugType)pi.PropertyType
- );
- }
- }
-
- public override object VisitInvocationExpression(InvocationExpression invocationExpression, object data)
- {
- TypedValue target;
- DebugType targetType;
- string methodName;
- MemberReferenceExpression memberRef = invocationExpression.TargetObject as MemberReferenceExpression;
- if (memberRef != null) {
- // TODO: Optimize
- try {
- // Instance
- target = Evaluate(memberRef.TargetObject);
- targetType = target.Type;
- } catch (GetValueException) {
- // Static
- target = null;
- targetType = memberRef.TargetObject.ResolveType(context.AppDomain);
- }
- methodName = memberRef.MemberName;
- } else {
- IdentifierExpression ident = invocationExpression.TargetObject as IdentifierExpression;
- if (ident != null) {
- target = Evaluate(new ThisReferenceExpression());
- targetType = target.Type;
- methodName = ident.Identifier;
- } else {
- throw new GetValueException("Member reference expected for method invocation");
- }
- }
- List args = EvaluateAll(invocationExpression.Arguments);
- MethodInfo method = targetType.GetMethod(methodName, DebugType.BindingFlagsAllInScope, null, GetTypes(args), null);
- if (method == null)
- throw new GetValueException("Method " + methodName + " not found");
- Value retVal = Value.InvokeMethod(this.EvalThread, target != null ? target.Value : null, method, GetValues(args));
- if (retVal == null)
- return null;
- return new TypedValue(retVal, (DebugType)method.ReturnType);
- }
-
- public override object VisitObjectCreateExpression(ObjectCreateExpression objectCreateExpression, object data)
- {
- if (!objectCreateExpression.ObjectInitializer.IsNull)
- throw new EvaluateException(objectCreateExpression.ObjectInitializer, "Object initializers not supported");
-
- DebugType type = objectCreateExpression.CreateType.ResolveType(context.AppDomain);
- List ctorArgs = EvaluateAll(objectCreateExpression.Parameters);
- DebugConstructorInfo ctor = (DebugConstructorInfo)type.GetConstructor(BindingFlags.Default, null, CallingConventions.Any, GetTypes(ctorArgs), null);
- if (ctor == null)
- throw new EvaluateException(objectCreateExpression, "Constructor not found");
- Value val = Value.InvokeMethod(this.EvalThread, null, ctor.MethodInfo, GetValues(ctorArgs));
- return new TypedValue(val, type);
- }
-
- public override object VisitArrayCreateExpression(ArrayCreateExpression arrayCreateExpression, object data)
- {
- if (arrayCreateExpression.CreateType.RankSpecifier[0] != 0)
- throw new EvaluateException(arrayCreateExpression, "Multi-dimensional arrays are not suppored");
-
- DebugType type = arrayCreateExpression.CreateType.ResolveType(context.AppDomain);
- int length = 0;
- if (arrayCreateExpression.Arguments.Count == 1) {
- length = EvaluateAsInt(arrayCreateExpression.Arguments[0]);
- } else if (!arrayCreateExpression.ArrayInitializer.IsNull) {
- length = arrayCreateExpression.ArrayInitializer.CreateExpressions.Count;
- }
- Value array = Eval.NewArray(this.EvalThread, (DebugType)type.GetElementType(), (uint)length, null);
- if (!arrayCreateExpression.ArrayInitializer.IsNull) {
- List inits = arrayCreateExpression.ArrayInitializer.CreateExpressions;
- if (inits.Count != length)
- throw new EvaluateException(arrayCreateExpression, "Incorrect initializer length");
- for(int i = 0; i < length; i++) {
- TypedValue init = EvaluateAs(inits[i], (DebugType)type.GetElementType());
- array.SetArrayElement(this.EvalThread, new int[] { i }, init.Value);
- }
- }
- return new TypedValue(array, type);
- }
-
- public override object VisitMemberReferenceExpression(MemberReferenceExpression memberReferenceExpression, object data)
- {
- TypedValue target;
- DebugType targetType;
- try {
- // Instance
- target = Evaluate(memberReferenceExpression.TargetObject);
- targetType = target.Type;
- } catch (GetValueException e) {
- // Static
- target = null;
- try {
- targetType = memberReferenceExpression.TargetObject.ResolveType(context.AppDomain);
- } catch (GetValueException) {
- throw e; // Use the other, nicer message
- }
- }
- MemberInfo[] memberInfos = targetType.GetMember(memberReferenceExpression.MemberName, DebugType.BindingFlagsAllInScope);
- if (memberInfos.Length == 0)
- throw new GetValueException("Member \"" + memberReferenceExpression.MemberName + "\" not found");
- return new TypedValue(
- Value.GetMemberValue(this.EvalThread, target != null ? target.Value : null, memberInfos[0]),
- ((IDebugMemberInfo)memberInfos[0]).MemberType
- );
- }
-
- public override object VisitParenthesizedExpression(ParenthesizedExpression parenthesizedExpression, object data)
- {
- return Evaluate(parenthesizedExpression.Expression);
- }
-
- public override object VisitPrimitiveExpression(PrimitiveExpression primitiveExpression, object data)
- {
- return CreateValue(primitiveExpression.Value);
- }
-
- TypedValue GetThisValue()
- {
- // This is needed so that captured 'this' is supported
- DebugLocalVariableInfo thisVar = context.MethodInfo.GetLocalVariableThis();
- if (thisVar != null)
- return new TypedValue(thisVar.GetValue(context), (DebugType)thisVar.LocalType);
-
- // when symbols are not present
- try {
- return new TypedValue(context.GetThisValue(), (DebugType)context.MethodInfo.DeclaringType);
- } catch (GetValueException) {
- // static method
- return null;
- }
- }
-
- public override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data)
- {
- TypedValue thisValue = GetThisValue();
- if (thisValue == null)
- throw new GetValueException(context.MethodInfo.FullName + " is static method and does not have \"this\"");
- return thisValue;
- }
-
- #region Binary and unary expressions
-
- public override object VisitUnaryOperatorExpression(UnaryOperatorExpression unaryOperatorExpression, object data)
- {
- TypedValue value = Evaluate(unaryOperatorExpression.Expression);
- UnaryOperatorType op = unaryOperatorExpression.Op;
-
- if (op == UnaryOperatorType.Dereference) {
- if (!value.Type.IsPointer)
- throw new GetValueException("Target object is not a pointer");
- return new TypedValue(value.Value.Dereference(), (DebugType)value.Type.GetElementType());
- }
-
- if (!value.Type.IsPrimitive)
- throw new GetValueException("Primitive value expected");
-
- if (op == UnaryOperatorType.Decrement || op == UnaryOperatorType.PostDecrement ||
- op == UnaryOperatorType.Increment || op == UnaryOperatorType.PostIncrement)
- {
- TypedValue oldValue = value;
- TypedValue newValue = null;
- try {
- if (op == UnaryOperatorType.Decrement || op == UnaryOperatorType.PostDecrement)
- newValue = (TypedValue)VisitAssignmentExpression(new AssignmentExpression(unaryOperatorExpression.Expression, AssignmentOperatorType.Subtract, new PrimitiveExpression(1)), null);
- if (op == UnaryOperatorType.Increment || op == UnaryOperatorType.PostIncrement)
- newValue = (TypedValue)VisitAssignmentExpression(new AssignmentExpression(unaryOperatorExpression.Expression, AssignmentOperatorType.Add, new PrimitiveExpression(1)), null);
- } catch (EvaluateException e) {
- throw new EvaluateException(unaryOperatorExpression, e.Message);
- }
- if (op == UnaryOperatorType.PostDecrement || op == UnaryOperatorType.PostIncrement) {
- return oldValue;
- } else {
- // Note: the old unaryOparatorExpression is still cached and still has the old value
- return newValue;
- }
- }
-
- if (op == UnaryOperatorType.Minus) {
- object val = value.PrimitiveValue;
- // Special case - it would promote the value to long otherwise
- if (val is uint && (uint)val == (uint)1 << 31)
- return CreateValue(int.MinValue);
-
- // Special case - it would overflow otherwise
- if (val is ulong && (ulong)val == (ulong)1 << 63)
- return CreateValue(long.MinValue);
- }
-
- if (op == UnaryOperatorType.Plus || op == UnaryOperatorType.Minus ||
- op == UnaryOperatorType.BitNot || op == UnaryOperatorType.Not)
- {
- Type[] overloads;
- if (op == UnaryOperatorType.Not) {
- overloads = new Type[] { typeof(bool) };
- } else if (op == UnaryOperatorType.Minus) {
- overloads = new Type[] { typeof(int), typeof(long), typeof(ulong), typeof(float), typeof(double) };
- } else {
- overloads = new Type[] { typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(float), typeof(double) };
- }
- foreach(Type argType in overloads) {
- if (value.Type.CanPromoteTo(argType)) {
- object a = Convert.ChangeType(value.PrimitiveValue, argType);
- object res;
- try {
- res = PerformUnaryOperation(a, op, argType);
- } catch (ArithmeticException e) {
- // Can happen for smaller int or long
- throw new EvaluateException(unaryOperatorExpression, e.Message);
- }
- if (res != null)
- return CreateValue(res);
- break; // Match only one overload
- }
- }
- }
-
- throw new EvaluateException(unaryOperatorExpression, "Can not use the unary operator {0} on type {1}", op.ToString(), value.Type.FullName);
- }
-
- ///
- /// Perform given arithmetic operation.
- /// The arguments must be already converted to the correct types.
- ///
- object PerformUnaryOperation(object val, UnaryOperatorType op, Type argType)
- {
- checked {
- if (argType == typeof(bool)) {
- bool a = (bool)val;
- switch (op) {
- case UnaryOperatorType.Not: return !a;
- }
- }
-
- if (argType == typeof(float)) {
- float a = (float)val;
- switch (op) {
- case UnaryOperatorType.Minus: return -a;
- case UnaryOperatorType.Plus: return +a;
- }
- }
-
- if (argType == typeof(double)) {
- double a = (double)val;
- switch (op) {
- case UnaryOperatorType.Minus: return -a;
- case UnaryOperatorType.Plus: return +a;
- }
- }
-
- if (argType == typeof(int)) {
- int a = (int)val;
- switch (op) {
- case UnaryOperatorType.Minus: return -a;
- case UnaryOperatorType.Plus: return +a;
- case UnaryOperatorType.BitNot: return ~a;
- }
- }
-
- if (argType == typeof(uint)) {
- uint a = (uint)val;
- switch (op) {
- case UnaryOperatorType.Plus: return +a;
- case UnaryOperatorType.BitNot: return ~a;
- }
- }
-
- if (argType == typeof(long)) {
- long a = (long)val;
- switch (op) {
- case UnaryOperatorType.Minus: return -a;
- case UnaryOperatorType.Plus: return +a;
- case UnaryOperatorType.BitNot: return ~a;
- }
- }
-
- if (argType == typeof(ulong)) {
- ulong a = (ulong)val;
- switch (op) {
- case UnaryOperatorType.Plus: return +a;
- case UnaryOperatorType.BitNot: return ~a;
- }
- }
- }
-
- return null;
- }
-
- public override object VisitBinaryOperatorExpression(BinaryOperatorExpression binaryOperatorExpression, object data)
- {
- BinaryOperatorType op = binaryOperatorExpression.Op;
-
- TypedValue left = Evaluate(binaryOperatorExpression.Left);
- TypedValue right = Evaluate(binaryOperatorExpression.Right);
-
- // Try to apply any implicit binary operation
- // Be careful to do these in correct order
-
- // ==, !=
- // bool operator ==(string x, string y);
- //
- // ==, != C is not Value type; other rules apply (must be after string)
- // bool operator ==(C x, C y);
-
- if (op == BinaryOperatorType.Equality || op == BinaryOperatorType.InEquality) {
- if (left.Type.Is() && right.Type.Is()) {
- if (left.Value.IsNull || right.Value.IsNull) {
- return CreateValue(left.Value.IsNull && right.Value.IsNull);
- } else {
- return CreateValue((string)left.PrimitiveValue == (string)right.PrimitiveValue);
- }
- }
- if (!left.Type.IsValueType && !right.Type.IsValueType) {
- // Reference comparison
- if (left.Value.IsNull || right.Value.IsNull) {
- return CreateValue(left.Value.IsNull && right.Value.IsNull);
- } else {
- return CreateValue(left.Value.Address == right.Value.Address);
- }
- }
- }
-
- // +
- // string operator +(string x, string y);
- // string operator +(string x, object y);
- // string operator +(object x, string y);
-
- if (op == BinaryOperatorType.Add) {
- if (left.Type.Is() || right.Type.Is()) {
- string a = left.Value.IsNull ? string.Empty : left.Value.InvokeToString(this.EvalThread);
- string b = right.Value.IsNull ? string.Empty : right.Value.InvokeToString(this.EvalThread);
- return CreateValue(a + b);
- }
- }
-
- // <<, >>
- // int operator <<(int x, int count);
- // uint operator <<(uint x, int count);
- // long operator <<(long x, int count);
- // ulong operator <<(ulong x, int count);
-
- if (op == BinaryOperatorType.ShiftLeft || op == BinaryOperatorType.ShiftRight) {
- Type[] overloads = { typeof(int), typeof(uint), typeof(long), typeof(ulong)};
- foreach(Type argType in overloads) {
- if (left.Type.CanPromoteTo(argType) && right.Type.CanPromoteTo(typeof(int))) {
- object a = Convert.ChangeType(left.PrimitiveValue, argType);
- object b = Convert.ChangeType(right.PrimitiveValue, typeof(int));
- // Shift operations never cause overflows
- object res = PerformBinaryOperation(a, b, op, argType);
- return CreateValue(res);
- }
- }
- }
-
- // *, /, %, +, and –
- // ==, !=, <, >, <=, >=,
- // &, ^, and | (except float and double)
- // int operator +(int x, int y);
- // uint operator +(uint x, uint y);
- // long operator +(long x, long y);
- // ulong operator +(ulong x, ulong y);
- // void operator +(long x, ulong y);
- // void operator +(ulong x, long y);
- // float operator +(float x, float y);
- // double operator +(double x, double y);
- //
- // &, |, ^, &&, ||
- // ==, !=
- // bool operator &(bool x, bool y);
-
- if (op != BinaryOperatorType.ShiftLeft && op != BinaryOperatorType.ShiftRight) {
- Type[] overloads = { typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(float), typeof(double), typeof(bool) };
- foreach(Type argType in overloads) {
- if (left.Type.CanPromoteTo(argType) && right.Type.CanPromoteTo(argType)) {
- if (argType == typeof(float) || argType == typeof(double)) {
- // Invalid overloads
- if (left.Type.CanPromoteTo(typeof(long)) && right.Type.CanPromoteTo(typeof(ulong)))
- break;
- if (left.Type.CanPromoteTo(typeof(ulong)) && right.Type.CanPromoteTo(typeof(long)))
- break;
- }
- object a = Convert.ChangeType(left.PrimitiveValue, argType);
- object b = Convert.ChangeType(right.PrimitiveValue, argType);
- object res;
- try {
- res = PerformBinaryOperation(a, b, op, argType);
- } catch (ArithmeticException e) {
- throw new EvaluateException(binaryOperatorExpression, e.Message);
- }
- if (res != null)
- return CreateValue(res);
- break; // Match only one overload
- }
- }
- }
-
- throw new EvaluateException(binaryOperatorExpression, "Can not use the binary operator {0} on types {1} and {2}", op.ToString(), left.Type.FullName, right.Type.FullName);
- }
-
- ///
- /// Perform given arithmetic operation.
- /// The arguments must be already converted to the correct types.
- ///
- object PerformBinaryOperation(object left, object right, BinaryOperatorType op, Type argTypes)
- {
- checked {
- if (argTypes == typeof(string)) {
- string a = (string)left;
- string b = (string)right;
- switch (op) {
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.Add: return a + b;
- }
- }
-
- if (argTypes == typeof(bool)) {
- bool a = (bool)left;
- bool b = (bool)right;
- switch (op) {
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.ExclusiveOr: return a ^ b;
- case BinaryOperatorType.BitwiseAnd: return a & b;
- case BinaryOperatorType.BitwiseOr: return a | b;
- case BinaryOperatorType.LogicalAnd: return a && b;
- case BinaryOperatorType.LogicalOr: return a || b;
- }
- }
-
- if (argTypes == typeof(float)) {
- float a = (float)left;
- float b = (float)right;
- switch (op) {
- case BinaryOperatorType.GreaterThan: return a > b;
- case BinaryOperatorType.GreaterThanOrEqual: return a >= b;
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.LessThan: return a < b;
- case BinaryOperatorType.LessThanOrEqual: return a <= b;
-
- case BinaryOperatorType.Add: return a + b;
- case BinaryOperatorType.Subtract: return a - b;
- case BinaryOperatorType.Multiply: return a * b;
- case BinaryOperatorType.Divide: return a / b;
- case BinaryOperatorType.Modulus: return a % b;
- case BinaryOperatorType.Concat: return a + b;
- }
- }
-
- if (argTypes == typeof(double)) {
- double a = (double)left;
- double b = (double)right;
- switch (op) {
- case BinaryOperatorType.GreaterThan: return a > b;
- case BinaryOperatorType.GreaterThanOrEqual: return a >= b;
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.LessThan: return a < b;
- case BinaryOperatorType.LessThanOrEqual: return a <= b;
-
- case BinaryOperatorType.Add: return a + b;
- case BinaryOperatorType.Subtract: return a - b;
- case BinaryOperatorType.Multiply: return a * b;
- case BinaryOperatorType.Divide: return a / b;
- case BinaryOperatorType.Modulus: return a % b;
- case BinaryOperatorType.Concat: return a + b;
- }
- }
-
- if (argTypes == typeof(int)) {
- switch (op) {
- case BinaryOperatorType.ShiftLeft: return (int)left << (int)right;
- case BinaryOperatorType.ShiftRight: return (int)left >> (int)right;
- }
- int a = (int)left;
- int b = (int)right;
- switch (op) {
- case BinaryOperatorType.BitwiseAnd: return a & b;
- case BinaryOperatorType.BitwiseOr: return a | b;
- case BinaryOperatorType.ExclusiveOr: return a ^ b;
-
- case BinaryOperatorType.GreaterThan: return a > b;
- case BinaryOperatorType.GreaterThanOrEqual: return a >= b;
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.LessThan: return a < b;
- case BinaryOperatorType.LessThanOrEqual: return a <= b;
-
- case BinaryOperatorType.Add: return a + b;
- case BinaryOperatorType.Subtract: return a - b;
- case BinaryOperatorType.Multiply: return a * b;
- case BinaryOperatorType.Divide: return a / b;
- case BinaryOperatorType.Modulus: return a % b;
- case BinaryOperatorType.Concat: return a + b;
- }
- }
-
- if (argTypes == typeof(uint)) {
- switch (op) {
- case BinaryOperatorType.ShiftLeft: return (uint)left << (int)right;
- case BinaryOperatorType.ShiftRight: return (uint)left >> (int)right;
- }
- uint a = (uint)left;
- uint b = (uint)right;
- switch (op) {
- case BinaryOperatorType.BitwiseAnd: return a & b;
- case BinaryOperatorType.BitwiseOr: return a | b;
- case BinaryOperatorType.ExclusiveOr: return a ^ b;
-
- case BinaryOperatorType.GreaterThan: return a > b;
- case BinaryOperatorType.GreaterThanOrEqual: return a >= b;
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.LessThan: return a < b;
- case BinaryOperatorType.LessThanOrEqual: return a <= b;
-
- case BinaryOperatorType.Add: return a + b;
- case BinaryOperatorType.Subtract: return a - b;
- case BinaryOperatorType.Multiply: return a * b;
- case BinaryOperatorType.Divide: return a / b;
- case BinaryOperatorType.Modulus: return a % b;
- case BinaryOperatorType.Concat: return a + b;
- }
- }
-
- if (argTypes == typeof(long)) {
- switch (op) {
- case BinaryOperatorType.ShiftLeft: return (long)left << (int)right;
- case BinaryOperatorType.ShiftRight: return (long)left >> (int)right;
- }
- long a = (long)left;
- long b = (long)right;
- switch (op) {
- case BinaryOperatorType.BitwiseAnd: return a & b;
- case BinaryOperatorType.BitwiseOr: return a | b;
- case BinaryOperatorType.ExclusiveOr: return a ^ b;
-
- case BinaryOperatorType.GreaterThan: return a > b;
- case BinaryOperatorType.GreaterThanOrEqual: return a >= b;
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.LessThan: return a < b;
- case BinaryOperatorType.LessThanOrEqual: return a <= b;
-
- case BinaryOperatorType.Add: return a + b;
- case BinaryOperatorType.Subtract: return a - b;
- case BinaryOperatorType.Multiply: return a * b;
- case BinaryOperatorType.Divide: return a / b;
- case BinaryOperatorType.Modulus: return a % b;
- case BinaryOperatorType.Concat: return a + b;
- }
- }
-
- if (argTypes == typeof(ulong)) {
- switch (op) {
- case BinaryOperatorType.ShiftLeft: return (ulong)left << (int)right;
- case BinaryOperatorType.ShiftRight: return (ulong)left >> (int)right;
- }
- ulong a = (ulong)left;
- ulong b = (ulong)right;
- switch (op) {
- case BinaryOperatorType.BitwiseAnd: return a & b;
- case BinaryOperatorType.BitwiseOr: return a | b;
- case BinaryOperatorType.ExclusiveOr: return a ^ b;
-
- case BinaryOperatorType.GreaterThan: return a > b;
- case BinaryOperatorType.GreaterThanOrEqual: return a >= b;
- case BinaryOperatorType.Equality: return a == b;
- case BinaryOperatorType.InEquality: return a != b;
- case BinaryOperatorType.LessThan: return a < b;
- case BinaryOperatorType.LessThanOrEqual: return a <= b;
-
- case BinaryOperatorType.Add: return a + b;
- case BinaryOperatorType.Subtract: return a - b;
- case BinaryOperatorType.Multiply: return a * b;
- case BinaryOperatorType.Divide: return a / b;
- case BinaryOperatorType.Modulus: return a % b;
- case BinaryOperatorType.Concat: return a + b;
- }
- }
-
- return null;
- }
- }
-
- #endregion
- }
-}
diff --git a/src/AddIns/Debugger/Debugger.Core/Properties/AssemblyInfo.cs b/src/AddIns/Debugger/Debugger.Core/Properties/AssemblyInfo.cs
index ecd6793867..bd424d0d40 100644
--- a/src/AddIns/Debugger/Debugger.Core/Properties/AssemblyInfo.cs
+++ b/src/AddIns/Debugger/Debugger.Core/Properties/AssemblyInfo.cs
@@ -14,4 +14,4 @@ using System.Reflection;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyCopyright("2005-2012 David Srbecký")]
-[assembly: AssemblyVersion("4.0.0.0")]
+[assembly: AssemblyVersion("5.0.0.0")]
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/AlphaTransparentBitmap.cs b/src/AddIns/DisplayBindings/IconEditor/AlphaTransparentBitmap.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/AlphaTransparentBitmap.cs
rename to src/AddIns/DisplayBindings/IconEditor/AlphaTransparentBitmap.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/IconEditor/Configuration/AssemblyInfo.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Configuration/AssemblyInfo.cs
rename to src/AddIns/DisplayBindings/IconEditor/Configuration/AssemblyInfo.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.Designer.cs b/src/AddIns/DisplayBindings/IconEditor/EditorPanel.Designer.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.Designer.cs
rename to src/AddIns/DisplayBindings/IconEditor/EditorPanel.Designer.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.cs b/src/AddIns/DisplayBindings/IconEditor/EditorPanel.cs
similarity index 96%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.cs
rename to src/AddIns/DisplayBindings/IconEditor/EditorPanel.cs
index e564c6b5b9..518065f7b0 100644
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.cs
+++ b/src/AddIns/DisplayBindings/IconEditor/EditorPanel.cs
@@ -96,7 +96,7 @@ namespace IconEditor
table.Visible = true;
}
- Color[] backgroundColors = {SystemColors.Control, SystemColors.Window, SystemColors.Desktop, SystemColors.ControlText};
+ Color[] backgroundColors = { SystemColors.Control, Color.Black, Color.White, Color.Teal, Color.DeepSkyBlue, Color.Red };
void ColorComboBoxDrawItem(object sender, DrawItemEventArgs e)
{
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.resx b/src/AddIns/DisplayBindings/IconEditor/EditorPanel.resx
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.resx
rename to src/AddIns/DisplayBindings/IconEditor/EditorPanel.resx
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconDisplayBinding.cs b/src/AddIns/DisplayBindings/IconEditor/IconDisplayBinding.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconDisplayBinding.cs
rename to src/AddIns/DisplayBindings/IconEditor/IconDisplayBinding.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/AssemblyInfo.cs b/src/AddIns/DisplayBindings/IconEditor/IconEditor/AssemblyInfo.cs
deleted file mode 100644
index fdb0c68c6a..0000000000
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/AssemblyInfo.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
-// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-
-using System.Reflection;
-
-// Information about this assembly is defined by the following
-// attributes.
-//
-// change them to the information which is associated with the assembly
-// you compile.
-
-[assembly: AssemblyTitle("IconEditor")]
-[assembly: AssemblyDescription("IconEditor with support for Windows Vista icons")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj b/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj
deleted file mode 100644
index 82ef792b21..0000000000
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
- Library
- IconEditor
- IconEditor
- Debug
- AnyCPU
- {DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}
- True
- False
- False
- Auto
- 134742016
- AnyCPU
- 4096
- 4
- false
- Always
- ..\..\..\..\..\AddIns\DisplayBindings\IconEditor\
- v4.0
- Client
-
-
- obj\Debug\
- False
- DEBUG;TRACE
- true
- Full
- True
-
-
- obj\
- obj\Release\
- True
- TRACE
- False
- None
- False
-
-
-
-
-
-
-
-
-
- MainForm.cs
-
-
-
-
-
-
- MainForm.cs
-
-
- IconPanel.cs
-
-
-
- IconPanel.cs
-
-
-
- EditorPanel.cs
-
-
-
- EditorPanel.cs
-
-
- GlobalAssemblyInfo.cs
-
-
-
-
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.sln b/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.sln
deleted file mode 100644
index af591b9d4d..0000000000
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.sln
+++ /dev/null
@@ -1,16 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# SharpDevelop 2.1.0.1626
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IconEditor", "IconEditor.csproj", "{DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}.Release|Any CPU.Build.0 = Release|Any CPU
- {DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- EndGlobalSection
-EndGlobal
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.Designer.cs b/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.Designer.cs
deleted file mode 100644
index 979785691d..0000000000
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.Designer.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
-// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-
-namespace IconEditor
-{
- partial class MainForm : System.Windows.Forms.Form
- {
- ///
- /// Designer variable used to keep track of non-visual components.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Disposes resources used by the form.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing) {
- if (components != null) {
- components.Dispose();
- }
- }
- base.Dispose(disposing);
- }
-
- ///
- /// This method is required for Windows Forms designer support.
- /// Do not change the method contents inside the source code editor. The Forms designer might
- /// not be able to load this method if it was changed manually.
- ///
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
- this.toolStrip1 = new System.Windows.Forms.ToolStrip();
- this.newToolStripButton = new System.Windows.Forms.ToolStripButton();
- this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
- this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
- this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
- this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();
- this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
- this.toolStrip1.SuspendLayout();
- this.SuspendLayout();
- //
- // toolStrip1
- //
- this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.newToolStripButton,
- this.openToolStripButton,
- this.saveToolStripButton,
- this.toolStripSeparator,
- this.helpToolStripButton});
- this.toolStrip1.Location = new System.Drawing.Point(0, 0);
- this.toolStrip1.Name = "toolStrip1";
- this.toolStrip1.Size = new System.Drawing.Size(331, 25);
- this.toolStrip1.TabIndex = 1;
- this.toolStrip1.Text = "toolStrip1";
- //
- // newToolStripButton
- //
- this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
- this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image")));
- this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.newToolStripButton.Name = "newToolStripButton";
- this.newToolStripButton.Size = new System.Drawing.Size(23, 22);
- this.newToolStripButton.Text = "&New";
- this.newToolStripButton.Click += new System.EventHandler(this.NewToolStripButtonClick);
- //
- // openToolStripButton
- //
- this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
- this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image")));
- this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.openToolStripButton.Name = "openToolStripButton";
- this.openToolStripButton.Size = new System.Drawing.Size(23, 22);
- this.openToolStripButton.Text = "&Open";
- this.openToolStripButton.Click += new System.EventHandler(this.OpenToolStripButtonClick);
- //
- // saveToolStripButton
- //
- this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
- this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image")));
- this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.saveToolStripButton.Name = "saveToolStripButton";
- this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);
- this.saveToolStripButton.Text = "&Save";
- this.saveToolStripButton.Click += new System.EventHandler(this.SaveToolStripButtonClick);
- //
- // toolStripSeparator
- //
- this.toolStripSeparator.Name = "toolStripSeparator";
- this.toolStripSeparator.Size = new System.Drawing.Size(6, 25);
- //
- // helpToolStripButton
- //
- this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
- this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("helpToolStripButton.Image")));
- this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.helpToolStripButton.Name = "helpToolStripButton";
- this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);
- this.helpToolStripButton.Text = "He&lp";
- this.helpToolStripButton.Click += new System.EventHandler(this.HelpToolStripButtonClick);
- //
- // openFileDialog
- //
- this.openFileDialog.FileName = "openFileDialog1";
- this.openFileDialog.Filter = "Icon files|*.ico|Cursor files|*.cur|All files|*.*";
- //
- // MainForm
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(331, 305);
- this.Controls.Add(this.toolStrip1);
- this.Name = "MainForm";
- this.Text = "IconEditor";
- this.toolStrip1.ResumeLayout(false);
- this.toolStrip1.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- private System.Windows.Forms.OpenFileDialog openFileDialog;
- private System.Windows.Forms.ToolStripButton helpToolStripButton;
- private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
- private System.Windows.Forms.ToolStripButton saveToolStripButton;
- private System.Windows.Forms.ToolStripButton openToolStripButton;
- private System.Windows.Forms.ToolStripButton newToolStripButton;
- private System.Windows.Forms.ToolStrip toolStrip1;
- }
-}
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.cs b/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.cs
deleted file mode 100644
index 277781d935..0000000000
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
-// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Windows.Forms;
-
-namespace IconEditor
-{
- public partial class MainForm
- {
- [STAThread]
- public static void Main(string[] args)
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- //ScanIcons(new DirectoryInfo(@"d:\net\icons"));
- Application.Run(new MainForm());
- }
-
- // scan for invalid or special icons
- static void ScanIcons(DirectoryInfo dir)
- {
- foreach (DirectoryInfo subdir in dir.GetDirectories()) {
- ScanIcons(subdir);
- }
- foreach (FileInfo file in dir.GetFiles("*.ico")) {
- try {
- IconFile f = new IconFile(file.OpenRead());
- if (f.AvailableColorDepths.Contains(24)) {
- Debug.WriteLine(file.FullName + " - 24");
- }
- } catch (InvalidIconException ex) {
- Debug.WriteLine(file.FullName + " - " + ex.Message);
- }
- }
- }
-
- static void Save(string fileName, Stream data)
- {
- using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write)) {
- byte[] buffer = new byte[4096];
- int c;
- do {
- c = data.Read(buffer, 0, buffer.Length);
- if (c != 0)
- fs.Write(buffer, 0, c);
- } while (c != 0);
- }
- }
-
- EditorPanel pnl = new EditorPanel();
-
- public MainForm()
- {
- //
- // The InitializeComponent() call is required for Windows Forms designer support.
- //
- InitializeComponent();
-
- pnl.Dock = DockStyle.Fill;
- Controls.Add(pnl);
- Controls.SetChildIndex(pnl, 0);
-
- //IconFile f = new IconFile(@"D:\net\icons\WinXP\Internet.ico");
- //IconFile f = new IconFile(@"c:\temp\example-vista-icon-2.ico");
- //IconFile f = new IconFile(@"D:\NET\Icons\exit.ico");
- //pnl.ShowFile(f);
- }
-
- void HelpToolStripButtonClick(object sender, System.EventArgs e)
- {
- MessageBox.Show(@"SharpDevelop IconEditor:
-(C) Daniel Grunwald, 2006
-
-Contact me: daniel@danielgrunwald.de", "IconEditor");
- }
-
- string fileName;
-
- void NewToolStripButtonClick(object sender, System.EventArgs e)
- {
- fileName = null;
- pnl.ShowFile(new IconFile());
- }
-
- void OpenToolStripButtonClick(object sender, System.EventArgs e)
- {
- if (openFileDialog.ShowDialog() == DialogResult.OK) {
- try {
- pnl.ShowFile(new IconFile(openFileDialog.FileName));
- fileName = openFileDialog.FileName;
- } catch (InvalidIconException ex) {
- MessageBox.Show("Invalid icon file: " + ex.Message);
- } catch (IOException ex) {
- MessageBox.Show("Error opening icon file: " + ex.Message);
- }
- }
- }
-
- void SaveToolStripButtonClick(object sender, EventArgs e)
- {
- MessageBox.Show("not implemented");
- //pnl.SaveIcon(@"c:\temp\save.ico");
- }
- }
-}
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.resx b/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.resx
deleted file mode 100644
index a8b1f83577..0000000000
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.resx
+++ /dev/null
@@ -1,187 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
- wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
- u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
- 8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
- PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
- KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
- k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
- TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
- AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
- BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
- UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
- CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
- F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
- rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
- NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
- 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
- AAAAAElFTkSuQmCC
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
- k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
- V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
- KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
- huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
- LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
- lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
- cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
- e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
- 7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
- Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
-
-
-
-
- iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhhJREFUOE+1U09r
- E0EU70fIR9iPUBQ8eMrR46IN5JhCDz2oBA8SBHEpCMFgG5GiwdJdq2Ijqe6ldo3Wrmhri0gXazW2YbMt
- UdNmm45ulf7R/HwzU1hLIzn54LFvhvn9eW9nOjr+R0wvBLhTXEf6bgV9w0sYLJQx/uoz2mq9c7eRn2pA
- L67Bq+/i29YeWLBL9Q6u5ktI6w6Kr1dbE3HwA3sT/o8mbAfQRgE1LZPXtsPgbjZxaXAG4y/Kh0m48sbP
- JgwbiKYAwwLYNkR4DEje5HsMFSI5l3l2kGD6/RYezzeEMgfzwzzMWSCRlV9OFk0xqhl06wNy+Tchyb2n
- dXxhv4TVaFLazppAJ9VKL0MySxYoVI0hkXaw5AbovjAWEmTur4qBqZoEdfbKVCgTBObqdolBUW0ocRs1
- P8Cx2PWQ4PJtl6a9J+xLIB1OMHIilU2b1gSMqCZ9TdTq33FEHQgJcg8rWPF3qHcJVOKeyOyoJIioDqUk
- UFM2SuUqus4YIcHEzFdYji8GxIGROAc41JJHc6E1B58wRRqWhzFrEVduTR78E5mRBSz7v0l1H0AgXgsH
- +2DNcPBp3cep0/rhezA5V0Vfbg5ug+4CqaiaI/rmyWu+t1zdQIysDxdmW9/GiZcVnO+fgvHkI+YXV7BG
- 067VA9Ezt91Fyvq/wH8/lKHCW/RcfITj8Rs4evIaYmdHkBl63v4xtX1tLQ78AZ3a8qxOv4hDAAAAAElF
- TkSuQmCC
-
-
-
- 116, 17
-
-
\ No newline at end of file
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.addin b/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.addin
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.addin
rename to src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.addin
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.csproj b/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.csproj
similarity index 67%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.csproj
rename to src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.csproj
index fff2fd2f0a..c8e7ab6429 100644
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.csproj
+++ b/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.csproj
@@ -7,8 +7,8 @@
Debug
AnyCPU
{DFB936AD-90EE-4B4F-941E-4F4A636F0D92}
- ..\..\..\..\..\AddIns\DisplayBindings\IconEditor\
- False
+ ..\..\..\..\AddIns\DisplayBindings\IconEditor\
+ True
False
False
Auto
@@ -30,12 +30,11 @@
True
- obj\
obj\Release\
True
TRACE
- False
- None
+ false
+ PdbOnly
False
@@ -46,27 +45,41 @@
+
+
+
+
+ IconPanel.cs
+
+
+
+ IconPanel.cs
+
+
+
+ EditorPanel.cs
+
+
+
+ EditorPanel.cs
+
Always
-
+
Configuration\GlobalAssemblyInfo.cs
-
-
+
+
-
- {DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}
- IconEditor
-
-
+
{2748AD25-9C63-4E12-877B-4DCE96FBED54}
ICSharpCode.SharpDevelop
False
-
+
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}
ICSharpCode.Core
False
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.sln b/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.sln
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.sln
rename to src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.sln
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEntry.cs b/src/AddIns/DisplayBindings/IconEditor/IconEntry.cs
similarity index 99%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEntry.cs
rename to src/AddIns/DisplayBindings/IconEditor/IconEntry.cs
index d601b8a5ef..4216fbd25c 100644
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEntry.cs
+++ b/src/AddIns/DisplayBindings/IconEditor/IconEntry.cs
@@ -474,8 +474,6 @@ namespace IconEditor
///
public void SetImage(Bitmap bitmap, bool storeCompressed)
{
- if (this.Type == IconEntryType.Classic)
- throw new InvalidOperationException("Cannot use SetImage on classic entries");
if (bitmap.Width != width || bitmap.Height != height) {
bitmap = new Bitmap(bitmap, width, height);
}
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconFile.cs b/src/AddIns/DisplayBindings/IconEditor/IconFile.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/IconFile.cs
rename to src/AddIns/DisplayBindings/IconEditor/IconFile.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.Designer.cs b/src/AddIns/DisplayBindings/IconEditor/IconPanel.Designer.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.Designer.cs
rename to src/AddIns/DisplayBindings/IconEditor/IconPanel.Designer.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.cs b/src/AddIns/DisplayBindings/IconEditor/IconPanel.cs
similarity index 97%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.cs
rename to src/AddIns/DisplayBindings/IconEditor/IconPanel.cs
index 5268fa5df0..a3d5cdf4a1 100644
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.cs
+++ b/src/AddIns/DisplayBindings/IconEditor/IconPanel.cs
@@ -6,6 +6,7 @@ using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Windows.Forms;
+using ICSharpCode.SharpDevelop;
namespace IconEditor
{
@@ -79,6 +80,7 @@ namespace IconEditor
IntPtr oldHBitmap = Gdi32.SelectObject(memDC, srcHBitmap);
Gdi32.BitBlt(destDC, drawOffset, drawOffset, size.Width, size.Height, memDC, 0, 0, Gdi32.SRCAND);
+ // TODO: review if the objects get destroyed correctly
Gdi32.SelectObject(memDC, oldHBitmap);
Gdi32.DeleteObject(srcHBitmap);
Gdi32.DeleteDC(memDC);
@@ -172,7 +174,6 @@ namespace IconEditor
void IconPanelMouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left) {
- /*
if (mouseDownLocation.IsEmpty == false) {
int dx = Math.Abs(e.X - mouseDownLocation.X);
int dy = Math.Abs(e.Y - mouseDownLocation.Y);
@@ -182,31 +183,28 @@ namespace IconEditor
this.DoDragDrop(bitmap, DragDropEffects.Copy);
}
}
- */
}
}
void IconPanelDragEnter(object sender, DragEventArgs e)
{
- /*
if (e.Data.GetDataPresent(typeof(Bitmap)))
e.Effect = DragDropEffects.Copy;
else
e.Effect = DragDropEffects.None;
- */
}
void IconPanelDragDrop(object sender, DragEventArgs e)
{
- /*try {
+ try {
Bitmap bmp = (Bitmap)e.Data.GetData(typeof(Bitmap));
if (bmp != null) {
entry.SetImage(bmp, entry.IsCompressed);
this.Entry = entry; // re-display entry
}
} catch (Exception ex) {
- MessageBox.Show(ex.ToString());
- }*/
+ SD.MessageService.ShowHandledException(ex);
+ }
}
}
}
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.resx b/src/AddIns/DisplayBindings/IconEditor/IconPanel.resx
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.resx
rename to src/AddIns/DisplayBindings/IconEditor/IconPanel.resx
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs b/src/AddIns/DisplayBindings/IconEditor/IconViewContent.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs
rename to src/AddIns/DisplayBindings/IconEditor/IconViewContent.cs
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditor/InvalidIconException.cs b/src/AddIns/DisplayBindings/IconEditor/InvalidIconException.cs
similarity index 100%
rename from src/AddIns/DisplayBindings/IconEditor/IconEditor/InvalidIconException.cs
rename to src/AddIns/DisplayBindings/IconEditor/InvalidIconException.cs
diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/Unregister/Main.cs b/src/AddIns/Misc/FiletypeRegisterer/Project/Unregister/Main.cs
deleted file mode 100644
index 264b86d58f..0000000000
--- a/src/AddIns/Misc/FiletypeRegisterer/Project/Unregister/Main.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
-// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
-
-/*
-using Microsoft.Win32;
-using System;
-
-namespace ICSharpCode.FiletypeRegisterer.Unregister
-{
-
- public class MainClass
- {
- const int SHCNE_ASSOCCHANGED = 0x08000000;
- const int SHCNF_IDLIST = 0x0;
-
- public static void UnRegisterFiletype(string extension) {
- try {
- Registry.ClassesRoot.DeleteSubKeyTree("SD." + extension + "file");
-
- RegistryKey extKey;
- extKey = Registry.ClassesRoot.OpenSubKey("." + extension, true);
-
- // if no association return
- if (extKey == null) return;
- // if other association return too
- if ((string)extKey.GetValue("", "") != ("SD." + extension + "file")) return;
-
- // restore previous association
- string prev = (string)extKey.GetValue("PreSD", "");
- if(prev != "") {
- extKey.SetValue("", prev);
- }
- extKey.Close();
-
-
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
- } catch {}
-
- }
-
- [System.Runtime.InteropServices.DllImport("shell32.dll")]
- static extern void SHChangeNotify(int wEventId, int uFlags, IntPtr dwItem1, IntPtr dwItem2);
-
- public static void Main() {
- Console.WriteLine("--------------------------------");
- Console.WriteLine(" Filetype Unregister");
- Console.WriteLine("--------------------------------");
-
- string[] args = Environment.GetCommandLineArgs();
- if (args.Length != 2) {
- Console.WriteLine("\nUsage: Unregister.exe ext");
- Console.WriteLine(" where ext is the extension, e.g. cs");
- return;
- }
-
- System.Console.WriteLine("Unregistering " + args[1] + "...");
- UnRegisterFiletype(args[1]);
- Console.WriteLine("\nSuccessful.");
- return;
- }
-
- }
-}
-*/
diff --git a/src/Main/SharpDevelop/SharpDevelop.csproj b/src/Main/SharpDevelop/SharpDevelop.csproj
index 04a9c46a72..af6d157638 100644
--- a/src/Main/SharpDevelop/SharpDevelop.csproj
+++ b/src/Main/SharpDevelop/SharpDevelop.csproj
@@ -139,8 +139,6 @@
-
-
{2FF700C2-A38A-48BD-A637-8CAFD4FE6237}
AvalonDock