public SequenceData GetSequenceData(string methodName, string typeName, string nameSpace, string assemblyName) { // here match the methodName in the methodcalllist structure // and populate the SequenceData field. var data = new SequenceData(typeName + methodName); data.AddObject(typeName); SelectMethod(methodName, typeName, nameSpace, assemblyName, data); return data; }
/// <summary> /// Selects the method. /// </summary> /// <param name="methodName">Name of the method.</param> /// <param name="typeName">Name of the type.</param> /// <param name="namespaceName">Name of the namespace.</param> /// <param name="data">The sequence data.</param> private void SelectMethod(string methodName, string typeName, string namespaceName, SequenceData data) { foreach (MethodCallInfo methodInfo in this.Data.MethodCallList) { if (methodInfo.StartMethod.Equals(namespaceName + "." + typeName + "." + methodName)) { data.AddObject(methodInfo.MethodCallType); data.AddMessage(methodInfo); Logger.Current.Info(">> Found method:" + methodInfo.ToString()); } } }
private void SelectMethod(string methodName, string typeName, string nameSpace, string assemblyName, SequenceData data) { foreach (MethodCallInfo mInfo in AssemblyData.MethodCallList) { if (!mInfo.StartMethod.Equals(nameSpace + "." + typeName + "." + methodName)) continue; data.AddObject(mInfo.MethodCallType); data.AddMessage(mInfo); Logger.Current.Debug(">> Found method:" + mInfo); // if targetAssembly is different from assemblyName then recursively call this method var targetAssembly = Helper.RemoveExtension(Helper.RemoveExtension(mInfo.TargetMethodAssembly, ".dll"), ".exe"); if (!targetAssembly.Equals(assemblyName)) { SelectMethod(mInfo.MethodCallName, mInfo.MethodCallType, mInfo.MethodCallNamespace, mInfo.TargetMethodAssembly, data); } } }
/// <summary> /// Gets the sequence data. /// </summary> /// <param name="methodName">Name of the method.</param> /// <param name="typeName">Name of the type.</param> /// <param name="namespaceName">Name of the namespace.</param> /// <returns> /// A new instance of SequenceData, with the related sequence data. /// </returns> private SequenceData GetSequenceData(string methodName, string typeName, string namespaceName) { // here match the methodName in the methodcalllist structure // and populate the SequenceData field. SequenceData data = new SequenceData(typeName + methodName); data.AddObject(typeName); this.SelectMethod(methodName, typeName, namespaceName, data); return data; }