Ignore:
Timestamp:
Aug 9, 2010, 3:10:10 PM (11 years ago)
Author:
Sven Rech
Message:

Changed input and output of PrimesGenerator and PrimeTest to BigInteger instead of String

Location:
trunk/CrypPlugins/PrimeTest
Files:
2 edited

Legend:

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

    r809 r1783  
    77using Cryptool.PluginBase.IO;
    88using Primes.Bignum;
     9using System.Numerics;
    910
    1011namespace PrimeTest
     
    9899
    99100    #region Properties
    100     private string m_InputString;
     101    private BigInteger m_InputNumber;
    101102    PrimesBigInteger m_Value = null;
    102     [PropertyInfo(Direction.InputData, "Text input", "Input a string that represent a natural number", "", true, false, DisplayLevel.Beginner, QuickWatchFormat.Text,null)]
    103     public string InputString
     103    [PropertyInfo(Direction.InputData, "Text input", "Input a BigInteger", "", true, false, DisplayLevel.Beginner, QuickWatchFormat.Text,null)]
     104    public BigInteger InputNumber
    104105    {
    105       get { return this.m_InputString; }
     106      get { return this.m_InputNumber; }
    106107      set
    107108      {
    108         if (value != m_InputString)
     109        if (value != m_InputNumber)
    109110        {
    110111          try
    111112          {
    112             if (!string.IsNullOrEmpty(value))
    113             {
    114               this.m_InputString = value;
    115               m_Value = new PrimesBigInteger(m_InputString.Trim());
    116               FirePropertyChangeEvent("InputString");
    117             }
    118             else
    119             {
    120               throw new Exception();
    121             }
    122 
     113            this.m_InputNumber = value;
     114            m_Value = new PrimesBigInteger(m_InputNumber.ToString());
     115            FirePropertyChangeEvent("InputString");
    123116          }
    124117          catch
  • trunk/CrypPlugins/PrimeTest/PrimeTest.csproj

    r1487 r1783  
    8585      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    8686    </Reference>
     87    <Reference Include="System.Numerics" />
    8788    <Reference Include="System.Xaml" />
    8889    <Reference Include="System.Xml.Linq">
Note: See TracChangeset for help on using the changeset viewer.