Browse Source

Add back the IconEditor AddIn.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
bbe4654da0
  1. 11
      SharpDevelop.sln
  2. 967
      src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluator.cs
  3. 2
      src/AddIns/Debugger/Debugger.Core/Properties/AssemblyInfo.cs
  4. 0
      src/AddIns/DisplayBindings/IconEditor/AlphaTransparentBitmap.cs
  5. 0
      src/AddIns/DisplayBindings/IconEditor/Configuration/AssemblyInfo.cs
  6. 0
      src/AddIns/DisplayBindings/IconEditor/EditorPanel.Designer.cs
  7. 2
      src/AddIns/DisplayBindings/IconEditor/EditorPanel.cs
  8. 0
      src/AddIns/DisplayBindings/IconEditor/EditorPanel.resx
  9. 0
      src/AddIns/DisplayBindings/IconEditor/IconDisplayBinding.cs
  10. 16
      src/AddIns/DisplayBindings/IconEditor/IconEditor/AssemblyInfo.cs
  11. 78
      src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj
  12. 16
      src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.sln
  13. 130
      src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.Designer.cs
  14. 108
      src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.cs
  15. 187
      src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.resx
  16. 0
      src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.addin
  17. 41
      src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.csproj
  18. 0
      src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.sln
  19. 2
      src/AddIns/DisplayBindings/IconEditor/IconEntry.cs
  20. 0
      src/AddIns/DisplayBindings/IconEditor/IconFile.cs
  21. 0
      src/AddIns/DisplayBindings/IconEditor/IconPanel.Designer.cs
  22. 12
      src/AddIns/DisplayBindings/IconEditor/IconPanel.cs
  23. 0
      src/AddIns/DisplayBindings/IconEditor/IconPanel.resx
  24. 0
      src/AddIns/DisplayBindings/IconEditor/IconViewContent.cs
  25. 0
      src/AddIns/DisplayBindings/IconEditor/InvalidIconException.cs
  26. 64
      src/AddIns/Misc/FiletypeRegisterer/Project/Unregister/Main.cs
  27. 2
      src/Main/SharpDevelop/SharpDevelop.csproj

11
SharpDevelop.sln

@ -107,6 +107,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HexEditor", "src\AddIns\Dis
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "src\AddIns\DisplayBindings\XmlEditor\Project\XmlEditor.csproj", "{DCA2703D-250A-463E-A68A-07ED105AE6BD}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "src\AddIns\DisplayBindings\XmlEditor\Project\XmlEditor.csproj", "{DCA2703D-250A-463E-A68A-07ED105AE6BD}"
EndProject 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}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Analysis", "Analysis", "{7019F43E-DFD7-4D1C-8C96-E75D55646DE7}"
ProjectSection(SolutionItems) = postProject ProjectSection(SolutionItems) = postProject
EndProjectSection EndProjectSection
@ -435,6 +437,14 @@ Global
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C}.Release|Any CPU.ActiveCfg = Release|Any CPU {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.Build.0 = Release|Any CPU
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C}.Release|x86.ActiveCfg = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -482,6 +492,7 @@ Global
{0162E499-42D0-409B-AA25-EED21F75336B} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F} {0162E499-42D0-409B-AA25-EED21F75336B} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
{E618A9CD-A39F-4925-A538-E8A3FEF24E54} = {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} {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} {1F261725-6318-4434-A1B1-6C70CE4CD324} = {7019F43E-DFD7-4D1C-8C96-E75D55646DE7}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E} {1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E} {EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {49CE38B8-0460-46BF-9DFF-5B33A0F9EB5E}

967
src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluator.cs

@ -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;
}
/// <summary> Evaluate given expression. If you have expression tree already, use overloads of this method.</summary>
/// <returns> Returned value or null for statements </returns>
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;
}
/// <summary>
/// Parses string representation of an expression (eg. "a.b[10] + 2") into NRefactory Expression tree.
/// </summary>
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<TypedValue> EvaluateAll(List<Expression> exprs)
{
List<TypedValue> vals = new List<TypedValue>(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<TypedValue> typedVals)
{
List<Value> vals = new List<Value>(typedVals.Count);
foreach(TypedValue typedVal in typedVals) {
vals.Add(typedVal.Value);
}
return vals.ToArray();
}
DebugType[] GetTypes(List<TypedValue> typedVals)
{
List<DebugType> types = new List<DebugType>(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<MemberInfo>(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<MemberInfo>(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<int> intIndexes = new List<int>();
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<TypedValue> 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<TypedValue> 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<TypedValue> 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<Expression> 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);
}
/// <summary>
/// Perform given arithmetic operation.
/// The arguments must be already converted to the correct types.
/// </summary>
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<string>() && right.Type.Is<string>()) {
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<string>() || right.Type.Is<string>()) {
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);
}
/// <summary>
/// Perform given arithmetic operation.
/// The arguments must be already converted to the correct types.
/// </summary>
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
}
}

2
src/AddIns/Debugger/Debugger.Core/Properties/AssemblyInfo.cs

@ -14,4 +14,4 @@ using System.Reflection;
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
[assembly: AssemblyCopyright("2005-2012 David Srbecký")] [assembly: AssemblyCopyright("2005-2012 David Srbecký")]
[assembly: AssemblyVersion("4.0.0.0")] [assembly: AssemblyVersion("5.0.0.0")]

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/AlphaTransparentBitmap.cs → src/AddIns/DisplayBindings/IconEditor/AlphaTransparentBitmap.cs

0
src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Configuration/AssemblyInfo.cs → src/AddIns/DisplayBindings/IconEditor/Configuration/AssemblyInfo.cs

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.Designer.cs → src/AddIns/DisplayBindings/IconEditor/EditorPanel.Designer.cs generated

2
src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.cs → src/AddIns/DisplayBindings/IconEditor/EditorPanel.cs

@ -96,7 +96,7 @@ namespace IconEditor
table.Visible = true; 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) void ColorComboBoxDrawItem(object sender, DrawItemEventArgs e)
{ {

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/EditorPanel.resx → src/AddIns/DisplayBindings/IconEditor/EditorPanel.resx

0
src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconDisplayBinding.cs → src/AddIns/DisplayBindings/IconEditor/IconDisplayBinding.cs

16
src/AddIns/DisplayBindings/IconEditor/IconEditor/AssemblyInfo.cs

@ -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("")]

78
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>IconEditor</RootNamespace>
<AssemblyName>IconEditor</AssemblyName>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}</ProjectGuid>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>134742016</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<OutputPath>..\..\..\..\..\AddIns\DisplayBindings\IconEditor\</OutputPath>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainForm.cs" />
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="IconFile.cs" />
<Compile Include="IconEntry.cs" />
<Compile Include="InvalidIconException.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="IconPanel.Designer.cs">
<DependentUpon>IconPanel.cs</DependentUpon>
</Compile>
<Compile Include="IconPanel.cs" />
<EmbeddedResource Include="IconPanel.resx">
<DependentUpon>IconPanel.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="AlphaTransparentBitmap.cs" />
<Compile Include="EditorPanel.Designer.cs">
<DependentUpon>EditorPanel.cs</DependentUpon>
</Compile>
<Compile Include="EditorPanel.cs" />
<EmbeddedResource Include="EditorPanel.resx">
<DependentUpon>EditorPanel.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>GlobalAssemblyInfo.cs</Link>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

16
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.sln

@ -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

130
src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.Designer.cs generated

@ -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
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// 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.
/// </summary>
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;
}
}

108
src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.cs

@ -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");
}
}
}

187
src/AddIns/DisplayBindings/IconEditor/IconEditor/MainForm.resx

@ -1,187 +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="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="newToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
</value>
</data>
<data name="openToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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
</value>
</data>
<data name="saveToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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=
</value>
</data>
<data name="helpToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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
</value>
</data>
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>116, 17</value>
</metadata>
</root>

0
src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.addin → src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.addin

41
src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.csproj → src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.csproj

@ -7,8 +7,8 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DFB936AD-90EE-4B4F-941E-4F4A636F0D92}</ProjectGuid> <ProjectGuid>{DFB936AD-90EE-4B4F-941E-4F4A636F0D92}</ProjectGuid>
<OutputPath>..\..\..\..\..\AddIns\DisplayBindings\IconEditor\</OutputPath> <OutputPath>..\..\..\..\AddIns\DisplayBindings\IconEditor\</OutputPath>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib> <NoStdLib>False</NoStdLib>
<RegisterForComInterop>False</RegisterForComInterop> <RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
@ -30,12 +30,11 @@
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath> <IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<Optimize>True</Optimize> <Optimize>True</Optimize>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType> <DebugType>PdbOnly</DebugType>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -46,27 +45,41 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="IconFile.cs" />
<Compile Include="IconEntry.cs" />
<Compile Include="InvalidIconException.cs" />
<Compile Include="IconPanel.Designer.cs">
<DependentUpon>IconPanel.cs</DependentUpon>
</Compile>
<Compile Include="IconPanel.cs" />
<EmbeddedResource Include="IconPanel.resx">
<DependentUpon>IconPanel.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="AlphaTransparentBitmap.cs" />
<Compile Include="EditorPanel.Designer.cs">
<DependentUpon>EditorPanel.cs</DependentUpon>
</Compile>
<Compile Include="EditorPanel.cs" />
<EmbeddedResource Include="EditorPanel.resx">
<DependentUpon>EditorPanel.cs</DependentUpon>
</EmbeddedResource>
<None Include="IconEditorAddIn.addin"> <None Include="IconEditorAddIn.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<Compile Include="Configuration\AssemblyInfo.cs" /> <Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs"> <Compile Include="..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>Configuration\GlobalAssemblyInfo.cs</Link> <Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="Src\IconDisplayBinding.cs" /> <Compile Include="IconDisplayBinding.cs" />
<Compile Include="Src\IconViewContent.cs" /> <Compile Include="IconViewContent.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\IconEditor\IconEditor.csproj"> <ProjectReference Include="..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{DC1CCE11-CB91-40FA-9C47-4D9EB5D67BFD}</Project>
<Name>IconEditor</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> <Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name> <Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> <ProjectReference Include="..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> <Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name> <Name>ICSharpCode.Core</Name>
<Private>False</Private> <Private>False</Private>

0
src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/IconEditorAddIn.sln → src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn.sln

2
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEntry.cs → src/AddIns/DisplayBindings/IconEditor/IconEntry.cs

@ -474,8 +474,6 @@ namespace IconEditor
/// </summary> /// </summary>
public void SetImage(Bitmap bitmap, bool storeCompressed) 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) { if (bitmap.Width != width || bitmap.Height != height) {
bitmap = new Bitmap(bitmap, width, height); bitmap = new Bitmap(bitmap, width, height);
} }

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconFile.cs → src/AddIns/DisplayBindings/IconEditor/IconFile.cs

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.Designer.cs → src/AddIns/DisplayBindings/IconEditor/IconPanel.Designer.cs generated

12
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.cs → src/AddIns/DisplayBindings/IconEditor/IconPanel.cs

@ -6,6 +6,7 @@ using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows.Forms;
using ICSharpCode.SharpDevelop;
namespace IconEditor namespace IconEditor
{ {
@ -79,6 +80,7 @@ namespace IconEditor
IntPtr oldHBitmap = Gdi32.SelectObject(memDC, srcHBitmap); IntPtr oldHBitmap = Gdi32.SelectObject(memDC, srcHBitmap);
Gdi32.BitBlt(destDC, drawOffset, drawOffset, size.Width, size.Height, memDC, 0, 0, Gdi32.SRCAND); 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.SelectObject(memDC, oldHBitmap);
Gdi32.DeleteObject(srcHBitmap); Gdi32.DeleteObject(srcHBitmap);
Gdi32.DeleteDC(memDC); Gdi32.DeleteDC(memDC);
@ -172,7 +174,6 @@ namespace IconEditor
void IconPanelMouseMove(object sender, MouseEventArgs e) void IconPanelMouseMove(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Left) { if (e.Button == MouseButtons.Left) {
/*
if (mouseDownLocation.IsEmpty == false) { if (mouseDownLocation.IsEmpty == false) {
int dx = Math.Abs(e.X - mouseDownLocation.X); int dx = Math.Abs(e.X - mouseDownLocation.X);
int dy = Math.Abs(e.Y - mouseDownLocation.Y); int dy = Math.Abs(e.Y - mouseDownLocation.Y);
@ -182,31 +183,28 @@ namespace IconEditor
this.DoDragDrop(bitmap, DragDropEffects.Copy); this.DoDragDrop(bitmap, DragDropEffects.Copy);
} }
} }
*/
} }
} }
void IconPanelDragEnter(object sender, DragEventArgs e) void IconPanelDragEnter(object sender, DragEventArgs e)
{ {
/*
if (e.Data.GetDataPresent(typeof(Bitmap))) if (e.Data.GetDataPresent(typeof(Bitmap)))
e.Effect = DragDropEffects.Copy; e.Effect = DragDropEffects.Copy;
else else
e.Effect = DragDropEffects.None; e.Effect = DragDropEffects.None;
*/
} }
void IconPanelDragDrop(object sender, DragEventArgs e) void IconPanelDragDrop(object sender, DragEventArgs e)
{ {
/*try { try {
Bitmap bmp = (Bitmap)e.Data.GetData(typeof(Bitmap)); Bitmap bmp = (Bitmap)e.Data.GetData(typeof(Bitmap));
if (bmp != null) { if (bmp != null) {
entry.SetImage(bmp, entry.IsCompressed); entry.SetImage(bmp, entry.IsCompressed);
this.Entry = entry; // re-display entry this.Entry = entry; // re-display entry
} }
} catch (Exception ex) { } catch (Exception ex) {
MessageBox.Show(ex.ToString()); SD.MessageService.ShowHandledException(ex);
}*/ }
} }
} }
} }

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconPanel.resx → src/AddIns/DisplayBindings/IconEditor/IconPanel.resx

0
src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs → src/AddIns/DisplayBindings/IconEditor/IconViewContent.cs

0
src/AddIns/DisplayBindings/IconEditor/IconEditor/InvalidIconException.cs → src/AddIns/DisplayBindings/IconEditor/InvalidIconException.cs

64
src/AddIns/Misc/FiletypeRegisterer/Project/Unregister/Main.cs

@ -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;
}
}
}
*/

2
src/Main/SharpDevelop/SharpDevelop.csproj

@ -139,8 +139,6 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="ProfilingSessions\Session20120329_181957.sdps" />
<Content Include="ProfilingSessions\Session20120329_182016.sdps" />
<ProjectReference Include="..\..\Libraries\AvalonDock\AvalonDock\AvalonDock.csproj"> <ProjectReference Include="..\..\Libraries\AvalonDock\AvalonDock\AvalonDock.csproj">
<Project>{2FF700C2-A38A-48BD-A637-8CAFD4FE6237}</Project> <Project>{2FF700C2-A38A-48BD-A637-8CAFD4FE6237}</Project>
<Name>AvalonDock</Name> <Name>AvalonDock</Name>

Loading…
Cancel
Save