1. Java / Говнокод #12686

    +74

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    private boolean userInOneRegistrationNode() throws DfException {
    
            String uname = OrganizationStaffStructureHelper.getCurrentUserName();
    
            int i = 0;
            IDfCollection NodesCol = DQLHelper.getCollection(DQL_GET_REGISTRATOR_DIV, new String[]{uname});
            while (NodesCol.next()) {
                if (!(NodesCol == null)) {
                    String group_name = NodesCol.getString(GROUP_NAME);
                    i = i + 1;
                }
            }
    
            if (i == 1) {
                return true;
            }
            return false;
    }

    Заменяется 2мя строками один - select count(*), вторая - полученный результат Integer.ValueOf(...).

    Landing, 04 Марта 2013

    Комментарии (3)
  2. C# / Говнокод #12684

    +140

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    [WebMethod]
            public void runCompareService(string mAuthToken, int documentId, int origVerNum, int revisedVerNum)
            {
                //string result = null;
                DirectoryInfo tmpDirInfo = getTempDirectoryPath(documentId);
                try
                {
                    //authToken = authClient.AuthenticateUser(username, password);
                    authToken = mAuthToken;
                    otAuth.AuthenticationToken = authToken;
    
                    try
                    {
                        string origFilePath = String.Format(tmpFilePath, tmpDirInfo.ToString(), origVerNum);
                        string revisedFilePath = String.Format(tmpFilePath, tmpDirInfo.ToString(), revisedVerNum);
                        string resultFilePath = String.Format(tmpResFilePath, tmpDirInfo.ToString(), origVerNum, revisedVerNum);
    
                        string origContextId = getDocContextId(documentId, origVerNum);
                        string revisedContextId = getDocContextId(documentId, revisedVerNum);
    
                        try
                        {
                            downlodFileByContextId(origContextId, origFilePath);
                            downlodFileByContextId(revisedContextId, revisedFilePath);
                            try
                            {
                                doCompare(origFilePath, revisedFilePath, resultFilePath);
                                try
                                {
                                    DownloadToBrowser(resultFilePath);
                                    
                                    //uploadResultToCS(targetId, resultFilePath);
                                }
                                catch (Exception e)
                                {
                                    throw new Exception(String.Format("Failed to Download To Browser. Error: {0}", e.ToString()));
                                }
                            }
                            catch (Exception e)
                            {
                                throw new Exception(String.Format("Failed to do compare method . Error: {0}", e.ToString()));
                            }
                        }
                        catch (Exception e)
                        {
                            throw new Exception(String.Format("Failed to create and download file. Error: {0}", e.ToString()));
                        }
                    }
                    catch (Exception e)
                    {
                        throw new Exception("Failed to get Context ID for version Exeption details: " + e.ToString());
                    }
    
                }
                catch (Exception e)
                {
                    throw new Exception("Failed to auth user. Exeption details: " + e.ToString());
                }
                finally
                {
                    docManClient.Close();
                    contentServiceClient.Close();
                    if (Directory.Exists(tmpDirInfo.ToString()))
                    {
                        tmpDirInfo.Delete(true);
                    }
                }
                
            }

    Landing, 04 Марта 2013

    Комментарии (23)
  3. C# / Говнокод #12683

    +106

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    using System;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Text;
    using System.Xml.Linq;
    
    namespace SplitSpace {
      class Program  {
        static void Main(string[] args) { 
            test();
        }
      
        static void test() {
          if(testfun(0, 0, 3, 1020, 0.05*180/Utils.PI, 1,  40, 5.80020838542985, 5.80020838542985, 0.0125032560359095)) return;
          if(testfun(0, 0, 3, 1020, 0.05*180/Utils.PI, 2,  5, 1.75, 9.85005209635745, 0.00156290700448869)) return;
          if(testfun(0, 0, 3, 1020, 0.05*180/Utils.PI, 3,  1.5, 0.0375078144536192, 0.0375078144536192, 0.000468872101346607)) return;
          if(testfun(0, 0, 3, 219, 0.00, 1,  15.000, 4.900000000, 4.900000000, 0.000000000)) return;
          if(testfun(0, 0, 3, 219, 0.50, 1,  15.000, 4.900000415, 4.900000415, 0.000142791)) return;
          if(testfun(0, 0, 3, 219, 5.00, 1,  15.000, 4.900415674, 4.900415674, 0.014290277)) return;
          if(testfun(0, 0, 3, 219, 5.10, 1,  15.000, 4.900441130, 4.900441130, 0.014868082)) return;
          if(testfun(0, 0, 3, 219, 5.90, 1,  15.000, 4.900683170, 4.900683170, 0.019903983)) return;
          // Спустя 8369 строчек
          // ...
          // ...
          // ...
          if(testfun(2, 1, 4, 1420, 55.00, 2,  7.000, 5.512975201, 5.512975201, 1.316853521)) return;
          if(testfun(2, 1, 4, 1420, 60.00, 2,  7.000, 5.817691454, 5.817691454, 1.558845727)) return;
          if(testfun(2, 1, 4, 1420, 66.00, 2,  7.000, 6.589343466, 6.589343466, 1.708953962)) return;
          if(testfun(2, 1, 4, 1420, 75.00, 2,  7.000, 7.385125168, 7.385125168, 2.367207113)) return;
          if(testfun(2, 1, 4, 1420, 85.10, 2,  7.000, 8.438873737, 8.438873737, 3.248627191)) return;
          if(testfun(2, 1, 4, 1420, 89.00, 2,  7.000, 8.848026526, 8.848026526, 3.610990132)) return;
          if(testfun(2, 1, 4, 1420, 89.99, 2,  7.000, 8.932590260, 8.932590260, 3.699354242)) return;
          if(testfun(2, 1, 4, 1420, 90.00, 2,  7.000, 8.932590181, 8.932590181, 3.700000000)) return;
    
          MessageBox.Show("OK!"); 
        }
    
        static bool testfun(int dir, int coolType, int hotType, double dia, double angG, int angType,  double Rad, double Tan1, double Tan2, double Bis) {
          // тут всякие тесты
          // ...
          // ...
          // ...
          return false;
        }
    
      } 
    }

    diimdeep , 04 Марта 2013

    Комментарии (8)
  4. C# / Говнокод #12682

    +106

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    namespace data_base
    { public class DatA
    { public struct DATA
    { public struct Yslovie { public string yslovie; public bool ActivE;}
    public Yslovie yslovie1;
    public Yslovie yslovie2;
    public Yslovie yslovie3;
    public string deistvie;};
    public DATA.Yslovie yslovie1 = new DATA.Yslovie();
    public DATA.Yslovie yslovie2 = new DATA.Yslovie();
    public DATA.Yslovie yslovie3 = new DATA.Yslovie();
    public DATA[] BD = new DATA[5];
    public void инициализация_БД()
    { BD[0].yslovie1.yslovie = "поставщик проверенный"; BD[0].yslovie1.ActivE = false;
    BD[0].yslovie2.yslovie = "товар качественный"; BD[0].yslovie2.ActivE = false;
    BD[0].yslovie3.yslovie = "цена приемлемая"; BD[0].yslovie3.ActivE = false;
    BD[0].deistvie = "Поставщик подходит";
    BD[1].yslovie1.yslovie = "поставщик давно на рынке"; BD[1].yslovie1.ActivE = false;
    BD[1].yslovie2.yslovie = "жалоб на поставщика не было"; BD[1].yslovie2.ActivE = false;
    BD[1].yslovie3.yslovie = null; BD[1].yslovie3.ActivE = false;
    BD[1].deistvie = "поставщик проверенный";
    BD[2].yslovie1.yslovie = "есть рекомендации от других заказчиков"; BD[2].yslovie1.ActivE = false;
    BD[2].yslovie2.yslovie = "поставка производится в срок"; BD[2].yslovie2.ActivE = false;
    BD[2].yslovie3.yslovie = "товар не получает дефектов в ходе транспатрировки"; BD[2].yslovie3.ActivE = false;
    BD[2].deistvie = "жалоб на поставщика не было";
    BD[3].yslovie1.yslovie = "товар сертифицирован"; BD[3].yslovie1.ActivE = false;
    BD[3].yslovie2.yslovie = "товар прощел государственные экспертизы"; BD[3].yslovie2.ActivE = false;
    BD[3].yslovie3.yslovie = null; BD[3].yslovie3.ActivE = false;
    BD[3].deistvie = "товар качественный";
    BD[4].yslovie1.yslovie = "цена чуть ниже чем у других поставщиков"; BD[4].yslovie1.ActivE = false;
    BD[4].yslovie2.yslovie = null; BD[4].yslovie2.ActivE = false;
    BD[4].yslovie3.yslovie = null; BD[4].yslovie3.ActivE = false;
    BD[4].deistvie = "цена приемлемая";
    }
    public void Констотация_факта(int i)
    { switch (i)
    { case 1: if (BD[0].yslovie1.ActivE == true) BD[0].yslovie1.ActivE = false;
    else BD[0].yslovie1.ActivE = true; break;
    case 2: if (BD[0].yslovie2.ActivE == true) BD[0].yslovie2.ActivE = false;
    else BD[0].yslovie2.ActivE = true; break;
    case 3: if (BD[0].yslovie3.ActivE == true) BD[0].yslovie3.ActivE = false;
    else BD[0].yslovie3.ActivE = true; break;
    case 4: if (BD[1].yslovie1.ActivE == true) BD[1].yslovie1.ActivE = false;
    else BD[1].yslovie1.ActivE = true; break;
    case 5: if (BD[1].yslovie2.ActivE == true) BD[1].yslovie2.ActivE = false;
    else BD[1].yslovie2.ActivE = true; break;
    case 6: if (BD[1].yslovie3.ActivE == true) BD[1].yslovie3.ActivE = false;
    else BD[1].yslovie3.ActivE = true; break;
    case 7: if (BD[2].yslovie1.ActivE == true) BD[2].yslovie1.ActivE = false;
    else BD[2].yslovie1.ActivE = true; break;
    case 8: if (BD[2].yslovie2.ActivE == true) BD[2].yslovie2.ActivE = false;
    else BD[2].yslovie2.ActivE = true; break;
    case 9: if (BD[2].yslovie3.ActivE == true) BD[2].yslovie3.ActivE = false;
    else BD[2].yslovie3.ActivE = true; break;
    case 10: if (BD[3].yslovie1.ActivE == true) BD[3].yslovie1.ActivE = false;
    else BD[3].yslovie1.ActivE = true; break;
    case 11: if (BD[3].yslovie2.ActivE == true) BD[3].yslovie2.ActivE = false;
    else BD[3].yslovie2.ActivE = true; break;
    case 12: if (BD[3].yslovie3.ActivE == true) BD[3].yslovie3.ActivE = false;
    else BD[3].yslovie3.ActivE = true; break;
    case 13: if (BD[4].yslovie1.ActivE == true) BD[4].yslovie1.ActivE = false;
    else BD[4].yslovie1.ActivE = true; break;
    case 14: if (BD[4].yslovie2.ActivE == true) BD[4].yslovie2.ActivE = false;
    else BD[4].yslovie2.ActivE = true; break;
    case 15: if (BD[4].yslovie3.ActivE == true) BD[4].yslovie3.ActivE = false;
    else BD[4].yslovie3.ActivE = true; break;}
    }}}

    оставлю тут

    Psilon, 04 Марта 2013

    Комментарии (15)
  5. Ruby / Говнокод #12681

    −92

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    def register_valid_login
    		login = params[:login]
    		return register_error("Слишком длинный ник!") if (login.length > 16) 
    		return register_error("Слишком короткий ник!") if (login.length < 3)
    		return register_error("Недопустимые символы в нике!") if !(/^[a-zA-Z\-_]+$/=~login)
    		return register_error("Можно использовать либо '-', либо '_' в нике!") if (login.count("-") > 0 && login.count("_") > 0)
    		return register_error("Ник должен состоять из трёх частей максимум!") if (login.count("-") > 2 || login.count("_") > 2)
    		login = [login] if (login.count("-") == 0 && login.count("_") == 0)
    		login = login.split("-") if login.count("-") > 0
    		login = login.split("_") if login.count("_") > 0
    		return register_error("Начало ника не может быть меньше трёх символов!") if (login[0].length < 1)
    		case login.count
    			when 2
    				return register_error("Если у вас ник вида Xxx_Yyy, то Yyy может состоять минимум из 3х букв") if (login[1].length < 3)
    			when 3
    				return register_error("Если у вас ник вида AAA_B_CCC, то B должна быть больше одной буквы") if (login[1].length < 1)
    		end
    		for i in 0..login.count-1
    			return register_error("Заглавная буква в середине " + (i+1).to_s + "-ой части ника") if !(/^[a-zA-Z]?[a-z]+$/=~login[i])
    		end
    		return true
    	end

    Процедура проверки ника в ситеме регистрации одного игрового проекта.

    DropWorld, 03 Марта 2013

    Комментарии (31)
  6. C# / Говнокод #12680

    +134

    1. 1
    2. 2
    3. 3
    4. 4
    public void Children_OnAdd(object sender, EventArgs e)
    {
       ((MyEventArgs<Document>)e).D.Parent = this;
    }

    taburetka, 03 Марта 2013

    Комментарии (7)
  7. C# / Говнокод #12679

    +131

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    public class UserData : EventArgs {
          public int UserCod { get; set; }
          public string Name { get; set; }
    
          public UserData(DataRow dataRow)
          {
             UserCod = (int)(decimal)dataRow["user_cod"];
             Name = (string)dataRow["name"];
          }
    }

    Во время рефакторинга появилось сообщение от VS UserData нельзя привести к типу UserData...
    Заглянули в один из классов UserData...
    теперь понятно откуда запах)))

    dukhovnyi, 02 Марта 2013

    Комментарии (12)
  8. Куча / Говнокод #12678

    +125

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    //сервер сайд (из colors.php)
    
    $colors = [
        'banana'   => 'yellow',
        'orange'   => 'orange',
        'cucumber' => 'green'
    ];
    
    echo $colors[$_GET['fruit']];
    
    
    //клиент сайд (js)
    var fruits = ['banana', 'orange', 'cucumber']
    for (var i in fruits) {
        var fruit = fruits[i]
        $.get('colors.php?fruit='+fruit, function(color){
            document.write(fruit +' is '+ color +'<br/>')
        })
    }

    Этот код показывают и задают вопрос почти на любом собеседовании на должность web-программита:
    Что здесь неверно и как это исправить?

    LispGovno, 02 Марта 2013

    Комментарии (82)
  9. C# / Говнокод #12677

    +128

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    /// <summary>
            /// Проверка нажатия 2 клавиш (напрмер: Ctrl+W)
            /// </summary>
            /// <param name="firstKey">Первая клавиша</param>
            /// <param name="hotKey">Сочетание из БД</param>
            /// <param name="e">Аргументы события нажатия клавиши</param>
            /// <param name="Scope">Область видимости</param>
            /// <returns>Действие</returns>
            private static string CheckMultipleKeyPress(string firstKey, DBHotKeys_new hotKey, KeyEventArgs e, HotKeyScope Scope)
            {
                System.Text.StringBuilder concat = new System.Text.StringBuilder();
                if (!string.IsNullOrEmpty(PreviousKey))
                {
                    concat.Append('+');
                }
                if (!string.IsNullOrEmpty(firstKey))
                {
                    concat.Append(firstKey).Append('+');
                }
                if (!string.IsNullOrEmpty(PreviousKey))
                {
                    concat.Append(PreviousKey).Append('+');
                }
                PreviousKey = ReplaceKeyCode(e.KeyCode);
    
                if (e.KeyCode != Keys.ControlKey)
                {
                    concat.Append(ReplaceKeyCode(e.KeyCode));
                }
    
                //if (concat[0] == '+')
                //{
                //    concat = new System.Text.StringBuilder(concat.ToString().Substring(1));
                //}
    
                if ((hotKey.Scope == Scope) && (concat.ToString().Equals(hotKey.HotKeyString)))
                {
                    PreviousKey = string.Empty;
                    return hotKey.Action;
                }
                PreviousKey = string.Empty;
                return string.Empty;
            }

    HLW, 02 Марта 2013

    Комментарии (0)
  10. C# / Говнокод #12676

    +138

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    /// <summary>
            /// Преобразование системных наименований клавиш в "понятные пользователю"
            /// </summary>
            /// <param name="key">Нажатая системная клавиша</param>
            /// <returns>Понятное представление</returns>
            public static string ReplaceKeyCode(System.Windows.Forms.Keys key)
            {
                switch (key)
                {
                    case Keys.OemQuestion: return "'?'";
                    case Keys.OemOpenBrackets: return "'{'";
                    case Keys.Oemtilde: return "'~'";
                    case Keys.Next: return "PageDown";
                }
                switch (key)
                {
                    case Keys.A: return "A";
                    case Keys.Add: return "Num'+'";
                    case Keys.Alt: return "Alt";
                    case Keys.B: return "B";
                    case Keys.Back: return "Backspace";
                    case Keys.C: return "C";
                    case Keys.Cancel: return "Cancel";
                    case Keys.Clear: return "Clear";
                    case Keys.ControlKey: return "Ctrl";
                    case Keys.D: return "D";
                    case Keys.D0: return "0";                case Keys.D1: return "1";                case Keys.D2: return "2";                case Keys.D3: return "3";
                    case Keys.D4: return "4";                case Keys.D5: return "5";                case Keys.D6: return "6";                case Keys.D7: return "7";
                    case Keys.D8: return "8";                case Keys.D9: return "9";                case Keys.Decimal: return "Num'.'";
                    case Keys.Delete: return "Delete";
                    case Keys.Divide: return "Num'/'";
                    case Keys.Down: return "Down";
                    case Keys.E: return "E";
                    case Keys.End: return "End";
                    case Keys.Escape: return "Esc";
                    case Keys.F: return "F";
                    case Keys.F1: return "F1";
                    case Keys.F10: return "F10";
                    case Keys.F11: return "F11";
                    case Keys.F12: return "F12";
                    case Keys.F2: return "F2";
                    case Keys.F3: return "F3";
                    case Keys.F4: return "F4";
                    case Keys.F5: return "F5";
                    case Keys.F6: return "F6";
                    case Keys.F7: return "F7";
                    case Keys.F8: return "F8";
                    case Keys.F9: return "F9";
                    case Keys.G: return "G";
                    case Keys.H: return "H";
                    case Keys.Home: return "Home";
                    case Keys.I: return "I";
                    case Keys.Insert: return "Insert";
                    case Keys.J: return "J";
                    case Keys.K: return "K";
                    case Keys.L: return "L";
                    case Keys.M: return "M";
                    case Keys.N: return "N";
                    case Keys.Next: return "Next";
                    case Keys.NumPad0: return "Num0";
                    case Keys.NumPad1: return "Num1";
                    case Keys.NumPad2: return "Num2";
                    case Keys.NumPad3: return "Num3";
                    case Keys.NumPad4: return "Num4";
                    case Keys.NumPad5: return "Num5";
                    case Keys.NumPad6: return "Num6";
                    case Keys.NumPad7: return "Num7";
                    case Keys.NumPad8: return "Num8";
                    case Keys.NumPad9: return "Num9";
                    case Keys.O: return "O";
                    case Keys.Oem1: return "';'";
                    case Keys.Oem5: return "'/'";
                    case Keys.Oem6: return "'{'";
                    case Keys.Oem7: return "\"";
                    case Keys.OemMinus: return "'-'";
                    case Keys.OemPeriod: return "'>'";
                    case Keys.Oemcomma: return "'<'";
                    case Keys.Oemplus: return "'+'";
                    case Keys.P: return "P";
                    case Keys.PageUp: return "PageUp";
                    case Keys.Q: return "Q";
                    case Keys.R: return "R";
                    case Keys.S: return "S";
                    case Keys.ShiftKey: return "Shift";
                    case Keys.Space: return "Space";
                    case Keys.Subtract: return "Num'-'";
                    case Keys.T: return "T";
                    case Keys.Tab: return "Tab";
                    case Keys.U: return "U";
                    case Keys.Up: return "Up";
                    case Keys.V: return "V";
                    case Keys.W: return "W"; 
                    case Keys.X: return "X";
                    case Keys.Y: return "Y";
                    case Keys.Z: return "Z";
                    case Keys.Menu: return "Alt";
                    case Keys.Multiply: return "Num'*'";
                    default: return string.Empty;
                }
            }

    HLW, 02 Марта 2013

    Комментарии (23)