private void OpenSourceCode(Assembly assembly, string buttonName) { string[] projectpath = assembly.FullName.Split(','); var folder = projectpath[0].Split('.')[1].Replace("demos", ""); string frameworkVersion = ""; string project = ""; string root = ""; if (buttonName == "openvisualstudio") { frameworkVersion = new System.Runtime.Versioning.FrameworkName(AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName).Version.ToString(); frameworkVersion = frameworkVersion.ToString().Replace(".", string.Empty); project = projectpath[0] + "_" + frameworkVersion + ".sln"; root = System.IO.Path.GetFullPath(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\\..\\" + folder + "\\" + project)); } else if (buttonName == "opengithub") { root = "https://github.com/syncfusion/wpf-demos/tree/master/" + folder; } if (!File.Exists(root) && buttonName == "openvisualstudio") { return; } try { var process = new ProcessStartInfo { FileName = root, UseShellExecute = true }; Process.Start(process); } catch (Exception e) { ErrorLogging.LogError("Requested directory not found." + "\n" + e.Message + "\n" + e.StackTrace); } }
/// <summary> /// Method used to excute <see cref="ProductDemosWindow"/> loaded event /// </summary> /// <param name="param"></param> private void ProductWindowLoaded(object param) { #if DEBUG if (CanAutomate) { try { BindingErrorAutomation.UpdateSelectedSample(); } catch (Exception exception) { if (this.SelectedProduct != null && this.SelectedSample != null) { ErrorLogging.LogError("Product Sample\\" + this.SelectedProduct.Product + "\\" + this.SelectedSample.SampleName + "@@" + exception.Message + " StackTrace: " + exception.StackTrace + " Exception Source: " + exception.Source); } else if (this.SelectedShowcaseSample != null) { ErrorLogging.LogError("Product ShowCase\\" + this.SelectedShowcaseSample.SampleName + "\\" + this.SelectedShowcaseSample.SampleName + "@@" + exception.Message + " StackTrace: " + exception.StackTrace + " Exception Source: " + exception.Source); } } } #endif }
public static void Init() { ErrorLogging.ClearPreviousLogs(); ErrorLogging.LogError("ErrorLogging Initialized"); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; }