Exemplo n.º 1
0
        protected override void VisitThrowException(ThrowException node, object data)
        {
            Exception obj, exc;

            state.Stack.Perform_Throw(out obj, out exc);
            HandleException(node, (exc == null) ? obj : exc);
        }
Exemplo n.º 2
0
        public string this[string culture]
        {
            get
            {
                switch (culture)
                {
                case "EN":
                    return(this.EN);
                }

                ThrowException.ThrowArgumentException("culture");

                return(null);                // for compilation only
            }
            set
            {
                switch (culture)
                {
                case "EN":
                    this.EN = value;
                    break;

                default:
                    ThrowException.ThrowArgumentException("culture");
                    break;
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Throws a ConditionException exception if the condition is not met.
 /// </summary>
 ///
 /// <param name="condition">
 /// The condition to meet.
 /// </param>
 ///
 /// <param name="message">
 /// The error message that explains the reason for the exception.
 /// </param>
 ///
 /// <param name="innerException">
 /// The exception that is the cause of the current exception.
 /// </param>
 public static void Required(bool condition, string message, Exception innerException)
 {
     if (!condition)
     {
         ThrowException.ThrowConditionException(message, innerException);
     }
 }
Exemplo n.º 4
0
        public async Task PreloadWithFailedActions()
        {
            var policy        = new BlockPolicy <ThrowException>();
            var fx1           = new DefaultStoreFixture(memory: true);
            var fx2           = new DefaultStoreFixture(memory: true);
            var minerChain    = TestUtils.MakeBlockChain(policy, fx1.Store, fx1.StateStore);
            var receiverChain = TestUtils.MakeBlockChain(policy, fx2.Store, fx2.StateStore);

            var minerKey = new PrivateKey();

            Swarm <ThrowException> minerSwarm    = CreateSwarm(minerChain, minerKey);
            Swarm <ThrowException> receiverSwarm = CreateSwarm(receiverChain);

            foreach (var unused in Enumerable.Range(0, 10))
            {
                await minerSwarm.BlockChain.MineBlock(minerKey);
            }

            try
            {
                await StartAsync(minerSwarm);

                await receiverSwarm.AddPeersAsync(new[] { minerSwarm.AsPeer }, null);

                await receiverSwarm.PreloadAsync(TimeSpan.FromSeconds(1));

                var action = new ThrowException {
                    ThrowOnExecution = true
                };

                var chainId = receiverChain.Id;
                Transaction <ThrowException> tx = Transaction <ThrowException> .Create(
                    0,
                    new PrivateKey(),
                    minerSwarm.BlockChain.Genesis.Hash,
                    new[] { action },
                    ImmutableHashSet <Address> .Empty,
                    DateTimeOffset.UtcNow
                    );

                Block <ThrowException> block = TestUtils.MineNext(
                    minerChain.Tip,
                    minerChain.Policy.GetHashAlgorithm,
                    new[] { tx },
                    miner: TestUtils.ChainPrivateKey.PublicKey,
                    difficulty: policy.GetNextBlockDifficulty(minerChain),
                    blockInterval: TimeSpan.FromSeconds(1)
                    ).Evaluate(TestUtils.ChainPrivateKey, minerChain);
                minerSwarm.BlockChain.Append(block, false, true, false);

                await receiverSwarm.PreloadAsync(TimeSpan.FromSeconds(1));

                // Preloading should succeed even if action throws exception.
                Assert.Equal(minerChain.Tip, receiverChain.Tip);
            }
            finally
            {
                await StopAsync(minerSwarm);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Filters a DataTable given an expression.
        /// </summary>
        ///
        /// <param name="table">
        /// DataTable to filter.
        /// </param>
        ///
        /// <param name="expression">
        /// Filter expression (COLUMNNAME = '{0}').
        /// </param>
        ///
        /// <param name="parameters">
        /// Optional parameters.
        /// </param>
        ///
        /// <returns>
        /// The filtered DataTable.
        /// </returns>
        public static DataTable Filter(DataTable table, string expression, params object[] parameters)
        {
            if (table == null)
            {
                ThrowException.ThrowArgumentNullException("table");
            }

            if (string.IsNullOrEmpty(expression))
            {
                ThrowException.ThrowArgumentNullException("expression");
            }

            if (table.Rows.Count == 0)
            {
                return(table);
            }

            DataTable tmpDt = new DataTable();

            DataRow[] rows = table.Select(!parameters.IsNullOrEmpty() ? string.Format(expression, parameters) : expression);

            if (rows != null && rows.Length != 0)
            {
                foreach (DataRow row in rows)
                {
                    tmpDt.ImportRow(row);
                }
            }

            return(tmpDt);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Loads the Smo Context.
        /// </summary>
        public void LoadContext()
        {
            if (!_isLoaded)
            {
                var database = this.GetSmoDatabase();
                if (database == null)
                {
                    ThrowException.Throw(
                        "Cannot access to database '{0}' on server '{1}' (database not found)",
                        this.DatabaseName,
                        this.DatabaseHost);
                }

                this.Tables     = new List <Table>();
                this.TableNames = new List <string>();

                foreach (Table table in database.Tables)
                {
                    if (table.IsSystemObject)
                    {
                        continue;
                    }

                    this.Tables.Add(table);
                    this.TableNames.Add(table.Name);
                }

                _isLoaded = true;
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Gets data from a binary file.
        /// </summary>
        ///
        /// <param name="filePath">
        /// Path of the binary file to read.
        /// </param>
        ///
        /// <param name="isCompressed">
        /// Value indicating whether the binary file is compressed.
        /// </param>
        ///
        /// <returns>
        /// A DataTable object.
        /// </returns>
        public object GetDataFromBinFile(string filePath, bool isCompressed = false)
        {
            if (!File.Exists(filePath))
            {
                ThrowException.ThrowFileNotFoundException(
                    string.Format("Cannot access to the file {0}", filePath),
                    filePath);
            }

            object obj = null;

            try
            {
                obj = SerializerHelper.ToObject <object>(filePath, isCompressed);
            }
            catch (Exception x)
            {
                string message = string.Format("Cannot deserialize the file {0}.", Path.GetFileName(filePath));

                message = string.Concat(message, (isCompressed) ? " Perhaps it is not compressed?" : " Perhaps it is compressed?");
                x.GetMessages().ForEach((error) => { message = string.Concat(message, Environment.NewLine, Environment.NewLine, error); });

                ThrowException.Throw(message, x);
            }

            return(obj);
        }
Exemplo n.º 8
0
 private static void Validate(bool truth, ThrowException exception)
 {
     if (!truth)
     {
         throw exception();
     }
 }
Exemplo n.º 9
0
        public void Load(string filePath)
        {
            if (!File.Exists(filePath))
            {
                ThrowException.ThrowFileNotFoundException("Cannot find the specified MDF file", filePath);
            }

            StreamReader fileReader = null;

            try
            {
                fileReader = new StreamReader(filePath);
                XmlSerializer serializer = new XmlSerializer(typeof(ModelDescriptorSchema));                 // can raise 2 FileNotFoundException -> continue execution

                this.Schema = (ModelDescriptorSchema)serializer.Deserialize(fileReader);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (fileReader != null)
                {
                    fileReader.Close();
                }
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Fill the entity properties using a source.
        /// </summary>
        ///
        /// <param name="source">
        /// Source.
        public override void Map(EntityBase source)
        {
            if (source == null)
            {
                ThrowException.ThrowArgumentNullException("source");
            }

            if (!(source is ExecutionTrace))
            {
                ThrowException.ThrowArgumentException("The 'source' argument is not a 'ExecutionTrace' instance");
            }

            this.Module        = ((ExecutionTrace)source).Module;
            this.ClassName     = ((ExecutionTrace)source).ClassName;
            this.MethodName    = ((ExecutionTrace)source).MethodName;
            this.Tag           = ((ExecutionTrace)source).Tag;
            this.MinDuration   = ((ExecutionTrace)source).MinDuration;
            this.MaxDuration   = ((ExecutionTrace)source).MaxDuration;
            this.TotalDuration = ((ExecutionTrace)source).TotalDuration;
            this.Counter       = ((ExecutionTrace)source).Counter;
            this.LastCall      = ((ExecutionTrace)source).LastCall;

            this.Id    = source.Id;
            this.State = source.State;
        }
Exemplo n.º 11
0
        /// <summary>
        /// Loads the wcfServiceTrackingConfiguration Xml section.
        /// </summary>
        /// <param name="sectionNode">The serviceProxyConfiguration root node.</param>
        internal void Load(XmlNode sectionNode)
        {
            if (sectionNode.Attributes["isEnabled"] == null)
            {
                ThrowException.ThrowConfigurationErrorsException(
                    "Cannot find the 'isEnabled' attribute on wcfServiceTrackingConfiguration section");
            }

            if (sectionNode.Attributes["withMessageLogging"] == null)
            {
                ThrowException.ThrowConfigurationErrorsException(
                    "Cannot find the 'withMessageLogging' attribute on wcfServiceTrackingConfiguration section");
            }

            string sIsEnabled = sectionNode.Attributes["isEnabled"].Value;

            if (string.IsNullOrEmpty(sIsEnabled))
            {
                ThrowException.ThrowConfigurationErrorsException(
                    "Cannot find the 'isEnabled' attribute value on wcfServiceTrackingConfiguration section");
            }

            this.IsEnabled = Convert.ToBoolean(sIsEnabled);

            string sWithMessageLogging = sectionNode.Attributes["withMessageLogging"].Value;

            if (string.IsNullOrEmpty(sWithMessageLogging))
            {
                ThrowException.ThrowConfigurationErrorsException(
                    "Cannot find the 'withMessageLogging' attribute value on wcfServiceTrackingConfiguration section");
            }

            this.WithMessageLogging = Convert.ToBoolean(sWithMessageLogging);
        }
Exemplo n.º 12
0
        public static string[] GetCultures(SmoContext smoContext)
        {
            IList <string> cultures     = new List <string>();
            SqlConnection  dbConnection = null;

            try
            {
                dbConnection = smoContext.GetSqlConnection(true);

                using (var dbCommand = new SqlCommand())
                {
                    dbCommand.CommandType = CommandType.Text;
                    dbCommand.CommandText = "SELECT TOP 1 * FROM [Translation];";
                    dbCommand.Connection  = dbConnection;

                    using (var dbReader = dbCommand.ExecuteReader())
                    {
                        for (int i = 0; i < dbReader.FieldCount; i++)
                        {
                            string columnName = dbReader.GetName(i);
                            if (columnName == "Translation_Id" || columnName == "Translation_Key")
                            {
                                continue;
                            }

                            string currentCulture = columnName.Replace("Translation_Value_", string.Empty);

                            Regex rx = new Regex("^[a-zA-Z]{2}$");
                            if (!rx.IsMatch(currentCulture))
                            {
                                ThrowException.Throw("The '{0}' column is not correct!", columnName);
                            }

                            cultures.Add(currentCulture);
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                if (dbConnection != null)
                {
                    if (dbConnection.State == ConnectionState.Open)
                    {
                        dbConnection.Close();
                    }
                    else
                    {
                        dbConnection.Dispose();
                    }
                }
            }

            return(cultures.ToArray());
        }
Exemplo n.º 13
0
 public static BigInteger FactorialInteger(int value)
 {
     if (value < 0)
     {
         ThrowException.ArgumentOutOfRangeException("value");
     }
     return(value < FactorialIntegerBuffer.Count ? FactorialIntegerBuffer[value] : FactorialInteger_(value));
 }
Exemplo n.º 14
0
        private void ThrowSecurityException(string message, params object[] args)
        {
            message = string.Format(message, args);

            LoggerServiceHelper.Current.WriteLine(this, LogStatusEnum.Warning, message);

            ThrowException.ThrowSecurityException(message);
        }
Exemplo n.º 15
0
 /// <summary>
 /// Установка значения ошибки выполнения.
 /// </summary>
 /// <param name="context">Конекст выполнения.</param>
 /// <param name="message">Сообщение об ошибке.</param>
 /// <exception cref="Exception">Вызывается если параметр <see cref="ThrowException"/> установлен в <c>true</c>.</exception>
 protected virtual void SetError(Context context, string message)
 {
     HasError.Set(context, true);
     ErrorMessage.Set(context, message);
     if (ThrowException.Get(context))
     {
         throw new InvalidWorkflowExecutionException(message);
     }
 }
Exemplo n.º 16
0
        /// <summary>
        /// Constructor.
        /// </summary>
        ///
        /// <param name="capacity">
        /// The capacity of the RoundStack&lt;T&gt;.
        /// </param>
        public RoundStack(int capacity)
        {
            if (capacity < 1)
            {
                ThrowException.ThrowArgumentOutOfRangeException("capacity");
            }

            _items = new T[capacity + 1];
        }
Exemplo n.º 17
0
        public static bool IsOwnershipEntity(this EntityBase entity)
        {
            if (entity == null)
            {
                ThrowException.ThrowArgumentNullException("entity");
            }

            return(entity is IOwnershipEntity);
        }
Exemplo n.º 18
0
        /// <summary>
        /// Стандартный метод запуска основной бизнес-логики действия процесса.
        /// </summary>
        /// <param name="executionContext">Контекста выполенения действия процесса.</param>
        protected override void Execute(CodeActivityContext executionContext)
        {
            var context = new Context(executionContext);

            try
            {
                if (_firstExecute)
                {
                    try
                    {
                        Configuring(context);
                        _firstExecute = false;
                    }
                    catch (Exception ex)
                    {
                        throw new WorkflowConfigurationException("System component setting error.\n Please contact support.", ex);
                    }
                }
                Execute(context);
            }
            catch (WorkflowConfigurationException ex)
            {
                TraceException(context, ex);
                if (!HasError.Get(executionContext))
                {
                    SetError(context, ex.Message);
                }
                if (ThrowException.Get(context))
                {
                    throw;
                }
            }
            catch (InvalidWorkflowExecutionException ex)
            {
                TraceException(context, ex);
                if (!HasError.Get(executionContext))
                {
                    SetError(context, ex.Message);
                }
                if (ThrowException.Get(context))
                {
                    throw;
                }
            }
            catch (Exception ex)
            {
                TraceException(context, ex);
                if (!HasError.Get(executionContext))
                {
                    SetError(context, ex.Message);
                }
                if (ThrowException.Get(context))
                {
                    throw new InvalidWorkflowExecutionException("An unexpected system error.\n Please contact support.", ex);
                }
            }
        }
Exemplo n.º 19
0
        public DelegateCommand(Action <object> action, Func <object, bool> canExecute)
        {
            if (action == null)
            {
                ThrowException.ThrowArgumentNullException("action");
            }

            _action     = action;
            _canExecute = canExecute;
        }
Exemplo n.º 20
0
        public BusinessContext(Assembly businessAssembly)
            : this()
        {
            if (businessAssembly == null)
            {
                ThrowException.ThrowArgumentNullException("assembly");
            }

            _businessAssembly = businessAssembly;
        }
Exemplo n.º 21
0
        private void should_ignore_exceptions_thrown_by_getters()
        {
            var blob = new ThrowException();

            var dictionary = ObjectMerging.ToDictionary(blob);

            var child = (Dictionary <string, object>)(dictionary["Prop"]);

            Assert.Equal(child["OcelogWarning"], "Exception thrown by invocation");
        }
Exemplo n.º 22
0
        private static void EmitDeserializeUserType(DataReaderMetadata dataReaderMetadata, FieldMap fieldMap, ILGenerator il, Type type, string[] columnNames, Type[] columnTypes)
        {
            var constructor = type.GetConstructor(Type.EmptyTypes);

            if (constructor == null)
            {
                ThrowException.NoDefaultConstructor();
            }

            var sample = Activator.CreateInstance(type);

            il.Emit(OpCodes.Newobj, constructor);

            var uniqueNames = new HashSet <string>();

            for (var ordinal = 0; ordinal < columnNames.Length; ordinal++)
            {
                var propertyInfo = type.GetProperty(columnNames[ordinal], BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase);
                if (propertyInfo == null)
                {
                    continue;
                }

                var getValueMethod = dataReaderMetadata.GetGetValueMethodFromType(columnTypes[ordinal]);

                if (propertyInfo.CanWrite && propertyInfo.GetSetMethod() != null)
                {
                    var propertyIsNullInitialized           = propertyInfo.CanRead && propertyInfo.GetValue(sample) == null;
                    var hasRequiredAttribute                = PropertyHasRequiredAttribute(propertyInfo);
                    var dataReaderPropertyValueDeserializer = new DataReaderValueDeserializer(dataReaderMetadata, getValueMethod, propertyInfo, ordinal);
                    dataReaderPropertyValueDeserializer.EmitDeserializeProperty(il, fieldMap, propertyIsNullInitialized, hasRequiredAttribute);

                    if (uniqueNames.Add(propertyInfo.Name) == false)
                    {
                        ThrowException.DuplicateFieldNames(propertyInfo.Name);
                    }

                    continue;
                }

                var fieldInfo = type.GetField("<" + propertyInfo.Name + ">k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic);
                if (fieldInfo != null)
                {
                    var fieldIsNullInitialized           = fieldInfo.GetValue(sample) == null;
                    var hasRequiredAttribute             = PropertyHasRequiredAttribute(propertyInfo);
                    var dataReaderFieldValueDeserializer = new DataReaderValueDeserializer(dataReaderMetadata, getValueMethod, fieldInfo, ordinal);
                    dataReaderFieldValueDeserializer.EmitDeserializeProperty(il, fieldMap, fieldIsNullInitialized, hasRequiredAttribute);

                    if (uniqueNames.Add(propertyInfo.Name) == false)
                    {
                        ThrowException.DuplicateFieldNames(propertyInfo.Name);
                    }
                }
            }
        }
Exemplo n.º 23
0
 private void MoveFileDownExcute(object obj)
 {
     try
     {
         listViewFileService.MoveDown(CurrentFiles);
     }
     catch (Exception e)
     {
         ThrowException?.Invoke(this, e.Message);
     }
 }
Exemplo n.º 24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContractMessage"/> class.
 /// </summary>
 /// <param name="messagePrefix">The message prefix.</param>
 /// <param name="throwException">The throw exception.</param>
 /// <param name="isSatisfied">The is failed.</param>
 /// <param name="getErrorMessage">The get error message.</param>
 public ContractMessage(
     string messagePrefix,
     ThrowException throwException,
     IsSatisfied isSatisfied,
     GetErrorMessage getErrorMessage)
 {
     this.messagePrefix   = messagePrefix;
     this.throwException  = throwException;
     this.isSatisfied     = isSatisfied;
     this.getErrorMessage = getErrorMessage;
 }
Exemplo n.º 25
0
        public BehaviorModel(UCWebBrowserEx wb, BeforeAddBehavior methodBeforeAddBehavior, AfterAddBehavior methodAfterAddBehavior, ThrowException methodThrowException, OnClick methodOnClick, MouseOverOnBrowser methodMouseOverOnBrowser)
        {
            this._webBrowser = wb;
            this._methodBeforeAddBehavior = methodBeforeAddBehavior;
            this._methodAfterAddBehavior = methodAfterAddBehavior;
            this._methodThrowException = methodThrowException;
            this._methodClick = methodOnClick;
            this._methodMouseOverOnBrowser = methodMouseOverOnBrowser;

            this.AttachEvent();
        }
Exemplo n.º 26
0
        public BehaviorModel(UCWebBrowserEx wb, BeforeAddBehavior methodBeforeAddBehavior, AfterAddBehavior methodAfterAddBehavior, ThrowException methodThrowException, OnClick methodOnClick, MouseOverOnBrowser methodMouseOverOnBrowser)
        {
            this._webBrowser = wb;
            this._methodBeforeAddBehavior  = methodBeforeAddBehavior;
            this._methodAfterAddBehavior   = methodAfterAddBehavior;
            this._methodThrowException     = methodThrowException;
            this._methodClick              = methodOnClick;
            this._methodMouseOverOnBrowser = methodMouseOverOnBrowser;

            this.AttachEvent();
        }
Exemplo n.º 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DbQuery"/> class.
        /// </summary>
        /// <param name="sql"> SQL Statement. </param>
        /// <param name="commandType"> The command Type. </param>
        /// <param name="commandTimeout">Wait time in seconds before terminating the query.</param>
        public DbQuery(string sql, CommandType commandType = CommandType.Text, int?commandTimeout = null)
        {
            if (sql == null)
            {
                ThrowException.ValueCannotBeNull(nameof(sql));
            }

            this.commandType    = commandType;
            this.sql            = sql;
            this.commandTimeout = commandTimeout;
        }
Exemplo n.º 28
0
        /// <summary>
        /// Performs mapping from a DataRow to an entity instance.
        /// </summary>
        ///
        /// <typeparam name="T">
        /// Type of the entity.
        /// </typeparam>
        ///
        /// <param name="source">
        /// Input DataRow object.
        /// </param>
        ///
        /// <param name="entity">
        /// Entity instance.
        /// </param>
        public void Map <T>(DataRow source, T entity)
        {
            var e = entity as EntityBase;

            if (e == null)
            {
                ThrowException.ThrowArgumentException(
                    "The 'entity' parameter must inherit the VahapYigit.Test.Models.EntityBase abstract class and must be instanciated");
            }

            e.Map(source);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ContractMessage"/> class.
        /// </summary>
        /// <param name="messagePrefix">The message prefix.</param>
        /// <param name="throwException">The throw exception.</param>
        /// <param name="isSatisfied">The is failed.</param>
        /// <param name="getErrorMessage">The get error message.</param>
        public ContractMessage(
            string messagePrefix, 
            ThrowException throwException,
            IsSatisfied isSatisfied,
            GetErrorMessage getErrorMessage)
        {
            this.messagePrefix = messagePrefix;
            this.throwException = throwException;
            this.isSatisfied = isSatisfied;
            this.getErrorMessage = getErrorMessage;

        }
Exemplo n.º 30
0
        /// <summary>
        /// Execute query and return number of affected rows.
        /// </summary>
        /// <param name="connection">Database connection.</param>
        /// <param name="parameters">Query parameters.</param>
        /// <param name="transaction">Transaction to use.</param>
        /// <returns>Number of affected rows.</returns>
        public int Execute(IDbConnection connection, object parameters = null, IDbTransaction transaction = null)
        {
            if (connection == null)
            {
                ThrowException.ValueCannotBeNull(nameof(connection));
            }

            using (var command = SetupCommand(connection, parameters, transaction))
            {
                return(command.ExecuteNonQuery());
            }
        }
Exemplo n.º 31
0
        private IDbCommand SetupCommand(IDbConnection connection, object parameters, IDbTransaction transaction)
        {
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }

            var command = connection.CreateCommand();

            command.CommandText = sql;
            command.CommandType = commandType;

            if (commandTimeout.HasValue)
            {
                command.CommandTimeout = commandTimeout.Value;
            }

            command.Transaction = transaction;

            var currentConnectionType = connection.GetType();

            if (parameters == null)
            {
                if (ReferenceEquals(connectionType, currentConnectionType) == false)
                {
                    connectionType = currentConnectionType;
                    returnType     = null;
                }

                return(command);
            }

            var currentParametersType = parameters.GetType();

            if (ReferenceEquals(parametersType, currentParametersType) == false || ReferenceEquals(connectionType, currentConnectionType) == false)
            {
                connectionType = currentConnectionType;
                parametersType = currentParametersType;
                returnType     = null;

                if (parametersType.IsClass == false)
                {
                    ThrowException.NotSupported();
                }

                parametersSerializer = ParametersSerializerCache.GetCachedOrBuildNew(connectionType, parametersType);
            }

            parametersSerializer.Serialize((DbParameterCollection)command.Parameters, parameters);

            return(command);
        }
Exemplo n.º 32
0
 public void Set(IEnumerable <double> dataX, IEnumerable <double> dataY)
 {
     if (dataX == null || dataY == null)
     {
         ThrowException.ArgumentException("dataX, dataY");
     }
     DataX = dataX.ToArray();
     DataY = dataY.ToArray();
     if (DataX.Length == 0 || DataY.Length == 0 || DataX.Length != DataY.Length)
     {
         ThrowException.ArgumentException("dataX, dataY");
     }
 }
 public MockExportedTypesAssembly(ThrowException throwException, params Type[] exportedTypes)
 {
     _throwException = throwException;
     _exportedTypes = exportedTypes;
 }
Exemplo n.º 34
0
 public void AddBehaviorModel(BeforeAddBehavior methodBeforeAddBehavior, AfterAddBehavior methodAfterAddBehavior, ThrowException methodThrowException, OnClickOnBrowser methodOnClickOnBrowser, MouseOverOnBrowser methodMouseOverOnBrowser)
 {
     if (this.behaviorModel == null)
     {
         this._methodBeforeAddBehavior = methodBeforeAddBehavior;
         this._methodAfterAddBehavior = methodAfterAddBehavior;
         this._methodThrowException = methodThrowException;
         this._methodOnClickOnBrowser = methodOnClickOnBrowser;
         this._methodMouseOverOnBrowser = methodMouseOverOnBrowser;
         this._methodMouseOverOnBrowser = methodMouseOverOnBrowser;
         this._methodOnClickOnBrowser = methodOnClickOnBrowser;
         this.behaviorModel = new BehaviorModel(this, this.methodBeforeAddBehavior, this.methodAfterAddBehavior, this.methodThrowExcepotion, this.methodOnClickOnBrowser, this.methodMouseOverOnBrowser);
     }
     else
     {
         this.behaviorModel.RestartBehavior();
     }
 }