Ignore:
Timestamp:
Oct 25, 2009, 12:07:59 PM (12 years ago)
Author:
Matthäus Wander
Message:
  • enabled more generic usage of ArrayIndexer and LengthOf
  • added ArrayIndexer, HMAC, LengthOf to setup
Location:
trunk/CrypPlugins/LengthOf
Files:
4 edited

Legend:

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

    r710 r777  
    1 using System;
     1/*
     2   Copyright 2009 Christian Arnold, Uni Duisburg-Essen
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16using System;
    217using System.Collections.Generic;
    318using System.Linq;
     
    924using System.ComponentModel;
    1025
    11 // Currently this PlugIn accepts every Array-Type, string and byte. In other cases a GuiMessage.Error is thrown.
     26// This PlugIn accepts every type. For arrays the number of elements is written.
     27// For everything else the number of characters of the object's string representation is shown.
    1228namespace Cryptool.Plugins.LengthOf
    1329{
     
    2137        private int outputLen = 0;
    2238
    23 
    2439        #region IPlugin Members
    2540
     
    2843            if (ObjInput != null)
    2944            {
    30                 Type typeInput = ObjInput.GetType();
    31                 if (typeInput.IsArray)
     45                if (ObjInput is Array)
    3246                {
    3347                    OutputLen = (ObjInput as Array).Length;
    34                     GuiLogMessage("Object is an array. Length: " + OutputLen, NotificationLevel.Info);
     48                    GuiLogMessage("Object is an array. Length: " + OutputLen, NotificationLevel.Debug);
    3549                }
    3650                else //no array
    3751                {
    38                     if (ObjInput is string)
    39                     {
    40                         string sInput = objInput as String;
    41                         OutputLen = sInput.Length;
    42                     }
    43                     else if (ObjInput is byte)
    44                     {
    45                         string sInput2 = ((byte)objInput).ToString();
    46                         OutputLen = sInput2.Length;
    47                     }
    48                     else
    49                     {
    50                         GuiLogMessage("Inputtype not handled!", NotificationLevel.Error);
    51                     }
    52                     //switch (typeInput.ToString())
    53                     //{
    54                     //    case "System.String":
    55                     //        string sInput = objInput as String;
    56                     //        OutputLen = sInput.Length;
    57                     //        break;
    58                     //    case "System.Byte":
    59                     //        string sInput2 = ((byte)objInput).ToString();
    60                     //        OutputLen = sInput2.Length;
    61                     //        break;
    62                     //    default:
    63                     //        GuiLogMessage("Inputtype not handled!", NotificationLevel.Error);
    64                     //        //throw new Exception("Inputtype not handled!");
    65                     //        break;
    66                     //}
    67                     GuiLogMessage("Object isn't an array. Length: " + OutputLen, NotificationLevel.Info);
     52                    OutputLen = ObjInput.ToString().Length;
     53                    GuiLogMessage("Object isn't an array. Length: " + OutputLen, NotificationLevel.Debug);
    6854                }
    6955            }
  • trunk/CrypPlugins/LengthOf/LengthOf.csproj

    r710 r777  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.21022</ProductVersion>
     6    <ProductVersion>9.0.30729</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{3ECF3335-7331-4E1A-942F-3340CDEC3EB9}</ProjectGuid>
     
    7676  </Target>
    7777  -->
     78  <PropertyGroup>
     79    <PostBuildEvent>cd "$(ProjectDir)"
     80cd ..\..\CrypWin\$(OutDir)
     81if not exist "./CrypPlugins" mkdir "./CrypPlugins"
     82
     83del /S /Q /A:-S-R-H "$(TargetName)*.*"
     84copy "$(TargetDir)$(TargetName)*.*" "./CrypPlugins"
     85
     86if not exist "./Data" mkdir "./Data"
     87if exist "$(TargetDir)Data" xcopy /Y /S "$(TargetDir)Data" "./Data"
     88</PostBuildEvent>
     89  </PropertyGroup>
    7890</Project>
  • trunk/CrypPlugins/LengthOf/LengthOfSettings.cs

    r710 r777  
    1 using System;
     1/*
     2   Copyright 2009 Christian Arnold, Uni Duisburg-Essen
     3
     4   Licensed under the Apache License, Version 2.0 (the "License");
     5   you may not use this file except in compliance with the License.
     6   You may obtain a copy of the License at
     7
     8       http://www.apache.org/licenses/LICENSE-2.0
     9
     10   Unless required by applicable law or agreed to in writing, software
     11   distributed under the License is distributed on an "AS IS" BASIS,
     12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13   See the License for the specific language governing permissions and
     14   limitations under the License.
     15*/
     16using System;
    217using System.Collections.Generic;
    318using System.Linq;
  • trunk/CrypPlugins/LengthOf/Properties/AssemblyInfo.cs

    r710 r777  
    3333// by using the '*' as shown below:
    3434// [assembly: AssemblyVersion("1.0.*")]
    35 [assembly: AssemblyVersion("1.0.0.0")]
    36 [assembly: AssemblyFileVersion("1.0.0.0")]
     35[assembly: AssemblyVersion("2.0.*")]
     36//[assembly: AssemblyFileVersion("1.0.0.0")]
Note: See TracChangeset for help on using the changeset viewer.