Beispiel #1
0
        public IError GetLightCopy()
        {
            var instance = new ProxyError();

            foreach (var property in typeof(IError).GetProperties())
            {
                if (property.CanRead && property.CanWrite)
                {
                    typeof(ProxyError).GetProperty(property.Name)
                    .SetValue(instance, typeof(ProxyError).GetProperty(property.Name).GetValue(this));
                }
            }

            return(instance);
        }
            public static async Task InsertErrorAsync(ProxyError error)
            {
                // Create a command object identifying the stored procedure
                using (var cmd = new SqlCommand("sp_InsertErrorLog"))
                {
                    //
                    // Set the command object so it knows to execute a stored procedure
                    cmd.CommandType = CommandType.StoredProcedure;
                    //
                    // Add parameters to command, which will be passed to the stored procedure
                    if (error.Snapshot.Value != null)
                        cmd.Parameters.AddWithValue("@ScreenCapture", error.Snapshot.Value.ToBytes());


                    cmd.Parameters.AddWithValue("@ServerDateTime", error.ServerDateTime);
                    cmd.Parameters.AddWithValue("@Host", error.Host);
                    cmd.Parameters.AddWithValue("@User", error.User);
                    cmd.Parameters.AddWithValue("@IsHandled", error.IsHandled);
                    cmd.Parameters.AddWithValue("@Type", error.ErrorType);
                    cmd.Parameters.AddWithValue("@AppName", error.AppName);
                    cmd.Parameters.AddWithValue("@CurrentCulture", error.CurrentCulture);
                    cmd.Parameters.AddWithValue("@CLRVersion", error.ClrVersion);
                    cmd.Parameters.AddWithValue("@Message", error.Message);
                    cmd.Parameters.AddWithValue("@Source", error.Source ?? "");
                    cmd.Parameters.AddWithValue("@StackTrace", error.StackTrace);
                    cmd.Parameters.AddWithValue("@ModuleName", error.ModuleName);
                    cmd.Parameters.AddWithValue("@MemberType", error.MemberType);
                    cmd.Parameters.AddWithValue("@Method", error.Method);
                    cmd.Parameters.AddWithValue("@Processes", error.Processes);
                    cmd.Parameters.AddWithValue("@ErrorDateTime", error.ErrorDateTime);
                    cmd.Parameters.AddWithValue("@OS", error.OS);
                    cmd.Parameters.AddWithValue("@IPv4Address", error.IPv4Address);
                    cmd.Parameters.AddWithValue("@MACAddress", error.MacAddress);
                    cmd.Parameters.AddWithValue("@HResult", error.HResult);
                    cmd.Parameters.AddWithValue("@Line", error.LineColumn.Line);
                    cmd.Parameters.AddWithValue("@Column", error.LineColumn.Column);
                    cmd.Parameters.AddWithValue("@Duplicate", error.Duplicate);
                    cmd.Parameters.AddWithValue("@Data", error.Data);
                    //
                    // execute the command

                    await ConnectionManager.GetDefaultConnection().ExecuteNonQueryAsync(cmd);
                }
            }
        private static async Task<Tuple<ProxyError, bool>> TransmitOneError(ProxyError error)
        {
            if (ErrorHandlingOption.EnableNetworkSending) // Server Connector to online or offline ?
            {
                try
                {
                    await SqlServerManager.InsertErrorAsync(error);
                }
                catch (AggregateException exp)
                {
                    // If an unhandled exception occurs during dataflow processing, all 
                    // exceptions are propagated through an AggregateException object.
                    ErrorHandlingOption.EnableNetworkSending = false;

                    exp.Handle(e =>
                    {
                        ErrorHandlingOption.AtSentState = false;
                        return true;
                    });
                }
            }
            // Mark the head of the pipeline as complete. The continuation tasks  
            // propagate completion through the pipeline as each part of the  
            // pipeline finishes.
            else
            {
                ErrorListenerTransformBlock.Complete();
                ErrorHandlingOption.AtSentState = false;
            }

            if (ErrorListenerTransformBlock.InputCount == 0)
                ErrorHandlingOption.AtSentState = false;
            //
            // Post to Acknowledge Action Block:
            return new Tuple<ProxyError, bool>(error, ErrorHandlingOption.EnableNetworkSending);
        }
        public IError GetLightCopy()
        {
            var instance = new ProxyError();

            foreach (var property in typeof(IError).GetProperties())
            {
                if (property.CanRead && property.CanWrite)
                    typeof(ProxyError).GetProperty(property.Name)
                    .SetValue(instance, typeof(ProxyError).GetProperty(property.Name).GetValue(this));
            }

            return instance;
        }
 public int GetHashCode(ProxyError obj)
 {
     return obj.GetHashCode();
 }
Beispiel #6
0
 public int GetHashCode(ProxyError obj)
 {
     return(obj.GetHashCode());
 }
 public void UpdateRow(ProxyError rowObj)
 {
     DataGridViewHelper<IError, ProxyError>.UpdateRow(this, rowObj);
 }
 public void RemoveRow(ProxyError rowObj)
 {
     DataGridViewHelper<IError, ProxyError>.RemoveRow(this, rowObj);
 }
 public void AddRow(ProxyError row)
 {
     DataGridViewHelper<IError, ProxyError>.AddRow(this, row);
 }