Ignore:
Timestamp:
Jan 3, 2009, 6:37:46 PM (13 years ago)
Author:
Thomas Schmid
Message:
  • TextOutput: supports object data type. QuickWatchData removed, because QuickWatchPresentation shows all the current data
Location:
trunk/CrypPlugins/TextOutput
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/TextOutput/TextOutput.cs

    r140 r178  
    326326        case TextOutputSettings.DynamicDataTypes.Integer:
    327327          return typeof(int);
     328        case TextOutputSettings.DynamicDataTypes.Object:
     329          return typeof(object);
    328330        default:
    329331          return null;
    330332      }
    331     }
    332 
    333     private QuickWatchFormat getQuickWatchFormat()
    334     {
    335       Type type = getCurrentType();
    336       if (type == typeof(CryptoolStream))
    337         return QuickWatchFormat.Hex;
    338       else if (type == typeof(string))
    339         return QuickWatchFormat.Text;
    340       else if (type == typeof(byte[]))
    341         return QuickWatchFormat.Hex;
    342       else if (type == typeof(bool))
    343         return QuickWatchFormat.Text;
    344       else if (type == typeof(int))
    345         return QuickWatchFormat.Text;
    346       else
    347         return QuickWatchFormat.None;
    348333    }
    349334
     
    372357          case TextOutputSettings.DynamicDataTypes.Integer:
    373358            return DicDynamicProperties[name].Value;
     359          case TextOutputSettings.DynamicDataTypes.Object:
     360            return DicDynamicProperties[name].Value;
    374361          default:
    375362            return null;
     
    385372      DicDynamicProperties.Add(name,
    386373        new DynamicProperty(name, getCurrentType(),
    387           new PropertyInfoAttribute(Direction.Input, name, toolTip, "", false, true, DisplayLevel.Beginner, getQuickWatchFormat(), null)));
     374          new PropertyInfoAttribute(Direction.Input, name, toolTip, "", false, true, DisplayLevel.Beginner, QuickWatchFormat.None, null))
     375      );
    388376    }
    389377
     
    399387
    400388        string fillValue = null;
    401         if (value is String || value is string)
     389        if (value is object || value is Object)
     390        {
     391          fillValue = value.ToString();
     392        }
     393        else if (value is String || value is string)
    402394        {
    403395          fillValue = value as string;
  • trunk/CrypPlugins/TextOutput/TextOutputSettings.cs

    r140 r178  
    224224
    225225    public enum EncodingTypes { Default = 0, Unicode = 1, UTF7 = 2, UTF8 = 3, UTF32 = 4, ASCII = 5, BigEndianUnicode = 6 };
    226     public enum DynamicDataTypes { CryptoolStream, String, ByteArray, Boolean, Integer };
     226    public enum DynamicDataTypes { CryptoolStream, String, ByteArray, Boolean, Integer , Object};
    227227    public bool CanChangeProperty { get; set; }
    228228
     
    358358    }
    359359
    360     [TaskPane("Type", "Select DataType of plugin.", "", 2, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "CryptoolStream", "string", "byte[]", "boolean", "int" })]
     360    [TaskPane("Type", "Select DataType of plugin.", "", 2, false, DisplayLevel.Beginner, ControlType.ComboBox, new string[] { "CryptoolStream", "string", "byte[]", "boolean", "int", "object"})]
    361361    public int DataType
    362362    {
Note: See TracChangeset for help on using the changeset viewer.