本文整理汇总了C#中System.Diagnostics.StackFrame类的典型用法代码示例。如果您正苦于以下问题:C# System.Diagnostics.StackFrame类的具体用法?C# System.Diagnostics.StackFrame怎么用?C# System.Diagnostics.StackFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Diagnostics.StackFrame类属于命名空间,在下文中一共展示了System.Diagnostics.StackFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WatchdogTimer
public WatchdogTimer(int Seconds)
{
TimerFrame = new System.Diagnostics.StackFrame(1);
CountownTimer = new Timer(Seconds * 1000.0);
CountownTimer.Elapsed += Elapsed;
CountownTimer.Start();
}
示例2: tbl_genLog_Logger
public void tbl_genLog_Logger(int ID_hrStaff,int ID_reqpUserID, int ID_LogType, string RequestText = "",string SessionID = "", string LogText = "")
{
ServiceConfig srvcont = new ServiceConfig(_ServiceConfigParameters);
try
{
System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(1);
var method = sf.GetMethod();
string methodName = method.Name;
DateTime dNow = DateTime.Now;
Entities.tbl_genLog userlog = new Entities.tbl_genLog();
//LogType 3 = UserAction
userlog.ID_LogType = ID_LogType;
userlog.LogID = methodName;
userlog.ID_Staff = ID_reqpUserID;
userlog.SessionID = SessionID;
userlog.RequestText = RequestText;
userlog.LogText = LogText;
userlog.TS_CREATE = dNow;
userlog.VALID_FROM = dNow;
userlog.VALID_TO = dNow;
userlog.CREATED_BY = ID_hrStaff;
srvcont.DataContext.tbl_genLog.AddObject(userlog);
srvcont.DataContext.SaveChanges();
}
catch (Exception)
{
//no action
}
}
示例3: SetProgress
public void SetProgress(int percent)
{
System.Reflection.MethodBase method = new System.Diagnostics.StackFrame(1).GetMethod();
MethodLabel.Text = method.DeclaringType.Name + "::" + method.Name + "()";
progressBar.Value = percent;
Application.DoEvents();
}
示例4: CreateSegment
public static bool CreateSegment(NetManager _this, out ushort segmentID, ref Randomizer randomizer, NetInfo info, ushort startNode, ushort endNode, Vector3 startDirection, Vector3 endDirection, uint buildIndex, uint modifiedIndex, bool invert)
{
var ai = info.m_netAI as RoadAI;
if (ai != null && ai.m_enableZoning)
{
var caller = new System.Diagnostics.StackFrame(1).GetMethod().Name;
switch (caller)
{
case "MoveMiddleNode": // segment that was modified because user added network, apply style of previous segment
newBlockColumnCount = MoveMiddleNode_releasedColumnCount >= 0 ?
MoveMiddleNode_releasedColumnCount : InputThreadingExtension.userSelectedColumnCount;
break;
case "SplitSegment": // segment that was split by new node, apply style of previous segment
newBlockColumnCount = SplitSegment_releasedColumnCount >= 0 ?
SplitSegment_releasedColumnCount : InputThreadingExtension.userSelectedColumnCount;
break;
default: // unknown caller (e.g. new road placed), set to depth selected by user
newBlockColumnCount = InputThreadingExtension.userSelectedColumnCount;
SplitSegment_releasedColumnCount = -1;
MoveMiddleNode_releasedColumnCount = -1;
break;
}
}
// Call original method
CreateSegmentRedirector.Revert();
var success = _this.CreateSegment(out segmentID, ref randomizer, info, startNode, endNode, startDirection, endDirection, buildIndex, modifiedIndex, invert);
CreateSegmentRedirector.Apply();
return success;
}
示例5: GetBillingPartyInformation
/// <summary>
/// Description : Get the Client information from CSS1
/// Created By : Sudheer
/// Created Date : 14th Oct 2014
/// Modified By :
/// Modified Date:
/// </summary>
public static _ChoosenBillingPartyInfo GetBillingPartyInformation(string ClientName, string WOID)
{
var GetClientInfo = new _ChoosenBillingPartyInfo();
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
try
{
SqlParameter[] sqlParams = new SqlParameter[2];
sqlParams[0] = new SqlParameter("@WOID", WOID);
sqlParams[1] = new SqlParameter("@ClientName", ClientName);
var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "GetAllBillingPartyDetails", sqlParams);
var safe = new SafeDataReader(reader);
while (reader.Read())
{
var ClientInfo = new _ChoosenClient();
ClientInfo.FetchBillingPartyInfo(ClientInfo, safe);
GetClientInfo._ChoosenBillingPartyList.Add(ClientInfo);
}
return GetClientInfo;
}
catch (Exception ex)
{
log.Error("Error: " + ex);
return GetClientInfo;
}
finally
{
log.Debug("End: " + methodBase.Name);
}
}
示例6: GetFilteredFrames
/// <summary>
/// Filters and copies the specified array of .NET stack frames
/// </summary>
/// <param name="stackFrames"></param>
/// <returns></returns>
private StackFrame[] GetFilteredFrames(SysStackFrame[] stackFrames) {
StackFrame[] result = null;
int resultIndex = 0;
for (int i = 0; i < stackFrames.Length; i++) {
SysStackFrame current = stackFrames[i];
// postpone allocating the array until we know how big it should be
if (result == null) {
// filter the top irrelevant frames from the stack
if (!this._stackTraceFilter.IsRelevant(current)) {
continue;
}
result = new StackFrame[stackFrames.Length + MethodsToKeep - i];
// copy last frames to stack
for (int j = i-MethodsToKeep; j < i; j++) {
result[resultIndex] = StackFrame.Create(stackFrames[j]);
resultIndex++;
}
}
result[resultIndex] = StackFrame.Create(stackFrames[i]);
resultIndex ++;
}
return result;
}
示例7: FillByUserName
internal static void FillByUserName(User user)
{
// #1- Logger variables
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
string className = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name;
string methodName = stackFrame.GetMethod().Name;
string query = "SELECT id, groupName,password,passwordDate,deleted,disabled,dateCreated,dateDeleted,dateDisabled FROM incuser WHERE userName = @userName";
Hashtable param = new Hashtable();
param.Add("@userName", user.userName);
// #2- Logger pre query
Logger.LogDebug("(%s) (%s) -- Ejecuta query para obtener todos los folios. QUERY: %s", className, methodName, query);
using (DataTable dt = ExecuteDataTableQuery(query, param))
{
if (dt != null && dt.Rows.Count > 0)
{
// #3- Logger post query
Logger.LogDebug("Row count: %s", dt.Rows.Count.ToString());
DataRow row = dt.Rows[0];
user.userName = user.userName;
user.id = (row["id"] != DBNull.Value) ? row["id"].ToString() : string.Empty;
user.groupName = (row["groupName"] != DBNull.Value) ? row["groupName"].ToString() : string.Empty;
user.password = (row["password"] != DBNull.Value) ? row["password"].ToString() : string.Empty;
user.passwordDate = (row["passwordDate"] != DBNull.Value) ? DateTime.Parse(row["passwordDate"].ToString()) : DateTime.Now;
user.deleted = (row["deleted"] != DBNull.Value) ? int.Parse(row["deleted"].ToString()) : 0;
user.disabled = (row["disabled"] != DBNull.Value) ? int.Parse(row["disabled"].ToString()) : 0;
user.dateCreated = (row["dateCreated"] != DBNull.Value) ? DateTime.Parse(row["dateCreated"].ToString()) : DateTime.Now;
user.dateDeleted = (row["dateDeleted"] != DBNull.Value) ? DateTime.Parse(row["dateDeleted"].ToString()) : DateTime.Now;
user.dateDisabled = (row["dateDisabled"] != DBNull.Value) ? DateTime.Parse(row["dateDisabled"].ToString()) : DateTime.Now;
}
}
}
示例8: LogError
/// <summary>
/// Logs an error using log4net
/// </summary>
/// <param name="ex">The error to log</param>
internal static void LogError(Exception ex)
{
MethodBase callingMethod = new System.Diagnostics.StackFrame(1, false).GetMethod();
ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
MDC.Set("requestinfo", String.Empty);
logger.Error(GetErrorMessageTitle(callingMethod.Name), ex);
}
示例9: Css1InfoDetails
public JsonResult Css1InfoDetails(string WOID, string WOType)
{
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
try
{
int checkSession = UserLogin.AuthenticateRequest();
if (checkSession == 0)
{
return Json(checkSession);
}
else
{
DataSet result = Masters.Models.Masters.Css1InfoDetail.GetCss1InfoDetails(WOID, WOType);
string data = JsonConvert.SerializeObject(result, Formatting.Indented);
return Json(data);
}
}
catch (Exception ex)
{
log.Error("Error: " + ex);
return Json("");
}
finally
{
log.Debug("End: " + methodBase.Name);
}
}
示例10: btnSave_Click
/// <summary>
/// 保存当前组用户
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
UpdateTempUser();
string users = "-1,";
if (ViewState["hdnRowValue"].ToString().Length > 0)
users += ViewState["hdnRowValue"].ToString().Replace("'", "");
users += "-1";
BLL.BLLBase bll = new BLL.BLLBase();
bll.ExecNonQuery("Security.UpdateUserGroup", new DataParameter[] { new DataParameter("@GroupID", GroupID), new DataParameter("{0}", users) });
ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.UpdatePanel1.GetType(), "Resize", "Close('1');", true);
}
catch(Exception ex)
{
System.Diagnostics.StackFrame frame = new System.Diagnostics.StackFrame(0);
Session["ModuleName"] = this.Page.Title;
Session["FunctionName"] = frame.GetMethod().Name;
Session["ExceptionalType"] = ex.GetType().FullName;
Session["ExceptionalDescription"] = ex.Message;
Response.Redirect("../../../Common/MistakesPage.aspx");
}
}
示例11: AuthenticateRequest
/// <summary>
/// Created By : hussain
/// Created Date : 15 May 2014
/// Modified By : Shiva
/// Modified Date : 16 Sep 2014
/// AuthenticateRequest
/// </summary>
/// <param name="Token">SessionToken</param>
/// <returns>Active Session:0 InActive Session: UserID</returns>
public static int AuthenticateRequest()
{
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
int userId = 0; ;
try
{
string SessionToken = Convert.ToString(HttpContext.Current.Session["CSS2SessionID"]);
if (!string.IsNullOrEmpty(SessionToken) ? true : false)
{
// User session is Active Session it returns users id else returns 0
userId = UserLogin.CheckUserSessionToken(SessionToken);
}
}
catch (Exception ex)
{
log.Error("Error: " + ex);
}
log.Debug("End: " + methodBase.Name);
return userId;
}
示例12: GetWOAddressDetails
/// <summary>
/// Description : Get WOAddress Details from database.
/// Created By : Pavan
/// Created Date : 12 August 2014
/// Modified By :
/// Modified Date:
/// </summary>
/// <returns></returns>
public static List<WOAddress> GetWOAddressDetails(int PersonID, string PersonSource)
{
var data = new List<WOAddress>();
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
try
{
SqlParameter[] sqlParams = new SqlParameter[2];
sqlParams[0] = new SqlParameter("@PersonID", PersonID);
sqlParams[1] = new SqlParameter("@PersonSource", PersonSource);
var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetWOAddressDetails]", sqlParams);
var safe = new SafeDataReader(reader);
while (reader.Read())
{
var woaddress = new WOAddress();
woaddress.FetchwoaddressDetails(woaddress, safe);
data.Add(woaddress);
}
return data;
}
catch (Exception ex)
{
log.Error("Error: " + ex);
return data;
}
finally
{
log.Debug("End: " + methodBase.Name);
}
}
示例13: GetAuditorDetailsByWOID
/// <summary>
/// Description : Get Auditors Details from database.
/// Created By : Pavan
/// Created Date : 23 August 2014
/// Modified By :
/// Modified Date:
/// </summary>
/// <returns></returns>
public static List<Auditors> GetAuditorDetailsByWOID(int WOID)
{
var data = new List<Auditors>();
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
try
{
SqlParameter[] sqlParams = new SqlParameter[1];
sqlParams[0] = new SqlParameter("@WOID", WOID);
var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetAuditorDetailsByWOID]", sqlParams);
var safe = new SafeDataReader(reader);
while (reader.Read())
{
var Auditors = new Auditors();
Auditors.FetchAuditors(Auditors, safe);
data.Add(Auditors);
}
return data;
}
catch (Exception ex)
{
log.Error("Error: " + ex);
return data;
}
finally
{
log.Debug("End: " + methodBase.Name);
}
}
示例14: GetCSS1GroupDetails
/// <summary>
/// Description : Get the Group information from CSS1
/// Created By : Shiva
/// Created Date : 10 July 2014
/// Modified By :
/// Modified Date:
/// </summary>
/// <returns></returns>
public static GroupInfo GetCSS1GroupDetails()
{
var data = new GroupInfo();
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
try
{
var lstGroupInfo = new List<GroupInfo>();
var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetCSS1GroupDetails");
var safe = new SafeDataReader(reader);
while (reader.Read())
{
var getGroupInfo = new GroupInfo();
getGroupInfo.FetchGroupInfo(getGroupInfo, safe);
lstGroupInfo.Add(getGroupInfo);
}
data.GroupInfoList = lstGroupInfo;
return data;
}
catch (Exception ex)
{
log.Error("Error: " + ex);
return data;
}
finally
{
log.Debug("End: " + methodBase.Name);
}
}
示例15: DeleteNote
public JsonResult DeleteNote(int ID)
{
System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
log.Debug("Start: " + methodBase.Name);
try
{
int checkSession = UserLogin.AuthenticateRequest();
if (checkSession == 0)
{
return Json(checkSession);
}
else
{
var data = new Note
{
ID = ID,
CreatedBy = checkSession
};
int output = data.DeleteNote();
return Json(output);
}
}
catch (Exception ex)
{
log.Error("Error: " + ex);
return Json("");
}
finally
{
log.Debug("End: " + methodBase.Name);
}
}