internal static void ValidateSize <T>(this IEnumerable <T> parameter, int size, string name)
 {
     if (parameter.Count() != size)
     {
         throw new MicrosoftDataEncryptionException(ArgSize.FormatInvariant(name, size));
     }
 }
Example #2
0
        public RegArg(string regName, MainWindowViewModel viewModel) : base(viewModel)
        {
            StringValue = regName;

            if (viewModel.GeneralRegister.Is16RegisterKey(regName))
            {
                Value = viewModel.GeneralRegister.Get16RegisterValue(regName);
                Size  = ArgSize._16Bit;
            }
            else if (viewModel.GeneralRegister.ContainsKey(regName))
            {
                Value = viewModel.GeneralRegister[regName];
                Size  = ArgSize._8Bit;
            }
            else if (viewModel.Register.ContainsKey(regName))
            {
                Value = viewModel.Register[regName];
                Size  = ArgSize._16Bit;
            }
        }