/// <summary> /// Writes a set of project invocation rules to a worksheet. /// </summary> /// <param name="ws">The worksheet to which the rules are to be written.</param> /// <param name="mode">The ExecutionMode to be written.</param> /// <param name="rules">The project invocation rules to be written.</param> public void Save(Excel.Worksheet ws, ExecutionMode mode, ProjectInvocationRule[] rules) { ws.Cells.ClearContents(); Helper.WriteCell(ws, 1, 1, mode.ToString()); var writer = new ProjectRuleDataWriter(); writer.Write(ws, rules, 2); }
public void WriteJson(ElasticsearchCrudJsonWriter elasticsearchCrudJsonWriter) { elasticsearchCrudJsonWriter.JsonWriter.WritePropertyName("terms"); elasticsearchCrudJsonWriter.JsonWriter.WriteStartObject(); JsonHelper.WriteListValue(_term, _termValues, elasticsearchCrudJsonWriter); JsonHelper.WriteValue("_cache", _cache, elasticsearchCrudJsonWriter, _cacheSet); JsonHelper.WriteValue("execution", _execution.ToString(), elasticsearchCrudJsonWriter, _executionSet); elasticsearchCrudJsonWriter.JsonWriter.WriteEndObject(); }
//////////////////////////////////////// ///////////GUI AND EDITOR STUFF///////// //////////////////////////////////////// #if UNITY_EDITOR protected override void OnNodeGUI() { base.OnNodeGUI(); if (nestedBT) { GUILayout.Label(executionMode.ToString()); } else { if (GUILayout.Button("CREATE NEW")) { nestedBT = (BehaviourTree)Graph.CreateNested(this, typeof(BehaviourTree), "Nested BT"); } } }
/// <summary> /// Global unhandled exception handler method /// </summary> /// <param name="ex">thrown exception</param> private void HandleException(Exception ex) { try { var aex = ex as AggregateException; if (ex.Message.Contains("8007007e") && ex.Message.Contains("CLSID {E5B8E079-EE6D-4E33-A438-C87F2E959254}")) { Setting.DisableGeoLocationService.Value = false; } // TODO:ロギング処理など Debug.WriteLine("##### SYSTEM CRASH! #####"); Debug.WriteLine(ex.ToString()); // Build stack trace report file var builder = new StringBuilder(); builder.AppendLine("Krile STARRYEYES #" + FormattedVersion + " - " + DateTime.Now.ToString()); builder.AppendLine(Environment.OSVersion + " " + (Environment.Is64BitProcess ? "x64" : "x86")); builder.AppendLine("execution mode: " + ExecutionMode.ToString() + ", " + "multicore JIT: " + IsMulticoreJitEnabled.ToString() + ", " + "hardware rendering: " + IsHardwareRenderingEnabled.ToString()); var uptime = DateTime.Now - _startupTime; builder.AppendLine("application uptime: " + ((int)uptime.TotalHours).ToString("00") + uptime.ToString("\\:mm\\:ss")); builder.AppendLine(); builder.AppendLine("exception stack trace:"); builder.AppendLine(ex.ToString()); #if DEBUG var tpath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "StarryEyes_Dump_" + Path.GetRandomFileName() + ".txt"); using (var sw = new StreamWriter(tpath)) { sw.WriteLine(builder.ToString()); } #else var tpath = Path.GetTempFileName() + ".crashlog"; using (var sw = new StreamWriter(tpath)) { sw.WriteLine(builder.ToString()); } var apppath = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]); var psi = new ProcessStartInfo { Arguments = tpath, UseShellExecute = true, FileName = Path.Combine(apppath, App.FeedbackAppName) }; try { Process.Start(psi); } catch { } #endif } finally { // Exit aplication AppFinalize(false); } Environment.Exit(-1); }