|
43 | 43 | using Couchcoding.Logbert.Properties; |
44 | 44 |
|
45 | 45 | using WeifenLuo.WinFormsUI.Docking; |
46 | | -using Couchcoding.Logbert.Gui.Helper; |
47 | | -using Couchcoding.Logbert.Theme.Palettes; |
48 | 46 | using Couchcoding.Logbert.Theme.Interfaces; |
49 | 47 | using Couchcoding.Logbert.Theme; |
50 | 48 | using Couchcoding.Logbert.Theme.Themes; |
@@ -888,58 +886,60 @@ private void CmsSaveMessagesCsvClick(object sender, EventArgs e) |
888 | 886 | /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
889 | 887 | protected override void Dispose(bool disposing) |
890 | 888 | { |
891 | | - if (disposing && components != null) |
| 889 | + if (disposing) |
892 | 890 | { |
893 | | - components.Dispose(); |
894 | | - } |
895 | | - |
896 | | - if (mLogProvider != null) |
897 | | - { |
898 | | - // Shutdown the logger functionality. |
899 | | - mLogProvider.Shutdown(); |
900 | | - |
901 | | - try |
902 | | - { |
903 | | - // Save the current docking layout. |
904 | | - using (MemoryStream memStream = new MemoryStream()) |
905 | | - { |
906 | | - LogDockPanel.SaveAsXml( |
907 | | - memStream |
908 | | - , Encoding.UTF8); |
909 | | - |
910 | | - memStream.Flush(); |
911 | | - |
912 | | - memStream.Seek( |
913 | | - 0 |
914 | | - , SeekOrigin.Begin); |
915 | | - |
916 | | - if (memStream.Length > 0) |
917 | | - { |
918 | | - mLogProvider.SaveLayout( |
919 | | - Encoding.UTF8.GetString(memStream.ToArray()) |
920 | | - , ((FrmLogWindow)mLogWindow).GetColumnLayout()); |
921 | | - } |
922 | | - } |
923 | | - } |
924 | | - catch (Exception ex) |
925 | | - { |
926 | | - Logger.Error( |
927 | | - "An error occured while saving the current docking layout: {0}" |
928 | | - , ex.Message); |
| 891 | + components?.Dispose(); |
| 892 | + |
| 893 | + if (mLogProvider != null) |
| 894 | + { |
| 895 | + // Shutdown the logger functionality. |
| 896 | + mLogProvider.Shutdown(); |
| 897 | + |
| 898 | + try |
| 899 | + { |
| 900 | + // Save the current docking layout. |
| 901 | + using (MemoryStream memStream = new MemoryStream()) |
| 902 | + { |
| 903 | + LogDockPanel.SaveAsXml( |
| 904 | + memStream |
| 905 | + , Encoding.UTF8); |
| 906 | + |
| 907 | + memStream.Flush(); |
| 908 | + |
| 909 | + memStream.Seek( |
| 910 | + 0 |
| 911 | + , SeekOrigin.Begin); |
| 912 | + |
| 913 | + if (memStream.Length > 0) |
| 914 | + { |
| 915 | + mLogProvider.SaveLayout( |
| 916 | + Encoding.UTF8.GetString(memStream.ToArray()) |
| 917 | + , ((FrmLogWindow)mLogWindow).GetColumnLayout()); |
| 918 | + } |
| 919 | + } |
| 920 | + } |
| 921 | + catch (Exception ex) |
| 922 | + { |
| 923 | + Logger.Error( |
| 924 | + "An error occured while saving the current docking layout: {0}" |
| 925 | + , ex.Message); |
| 926 | + } |
| 927 | + } |
| 928 | + |
| 929 | + if (tmrUpdate != null && tmrUpdate.Enabled) |
| 930 | + { |
| 931 | + tmrUpdate.Tick -= TmrUpdateTick; |
| 932 | + |
| 933 | + tmrUpdate.Stop(); |
| 934 | + tmrUpdate.Dispose(); |
929 | 935 | } |
930 | | - } |
931 | 936 |
|
932 | | - if (tmrUpdate != null && tmrUpdate.Enabled) |
933 | | - { |
934 | | - tmrUpdate.Tick -= TmrUpdateTick; |
935 | | - |
936 | | - tmrUpdate.Stop(); |
937 | | - tmrUpdate.Dispose(); |
| 937 | + ((ILogFilterHandler)mLogWindow).UnregisterFilterProvider(this); |
| 938 | + ((FrmLogWindow)mLogWindow).OnLogMessageSelected -= OnLogMessageSelected; |
| 939 | + |
| 940 | + mLogMessages?.Clear(); |
938 | 941 | } |
939 | 942 |
|
940 | | - ((ILogFilterHandler)mLogWindow).UnregisterFilterProvider(this); |
941 | | - ((FrmLogWindow)mLogWindow).OnLogMessageSelected -= OnLogMessageSelected; |
942 | | - |
943 | 943 | base.Dispose(disposing); |
944 | 944 | } |
945 | 945 |
|
@@ -1166,12 +1166,15 @@ public void SearchLogMessage(string pattern, bool searchForward = true, bool sea |
1166 | 1166 | } |
1167 | 1167 | } |
1168 | 1168 |
|
1169 | | - /// <summary> |
1170 | | - /// Applies the current theme to the <see cref="Control"/>. |
1171 | | - /// </summary> |
| 1169 | + /// <summary> |
| 1170 | + /// Applies the current theme to the <see cref="Control"/>. |
| 1171 | + /// </summary> |
1172 | 1172 | /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param> |
1173 | | - public void ApplyTheme(BaseTheme theme) |
| 1173 | + public void ApplyTheme(BaseTheme theme) |
1174 | 1174 | { |
| 1175 | + txtTimeShift.BackColor = theme.ColorPalette.ContentBackground; |
| 1176 | + txtTimeShift.ForeColor = theme.ColorPalette.ContentForeground; |
| 1177 | + |
1175 | 1178 | tsbShowTrace.Image = theme.Resources.Images["FrmMainTbTrace"]; |
1176 | 1179 | tsbShowDebug.Image = theme.Resources.Images["FrmMainTbDebug"]; |
1177 | 1180 | tsbShowInfo.Image = theme.Resources.Images["FrmMainTbInfo"]; |
|
0 commit comments