mirror of
https://github.com/chylex/Code-Statistics.git
synced 2025-08-16 06:31:41 +02:00
CodeStatistics
Data
Forms
Input
Project
Utils
ControlExtensions.cs
AboutForm.Designer.cs
AboutForm.cs
MainForm.Designer.cs
MainForm.cs
Handling
Input
Output
Properties
Resources
App.config
CodeStatistics.csproj
Program.cs
ProgramArguments.cs
ProgramConfiguration.cs
CodeStatisticsCore
CodeStatisticsTests
LanguageJava
.gitignore
CodeStatistics.sln
README.md
28 lines
713 B
C#
28 lines
713 B
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CodeStatistics.Forms.Utils{
|
|
static class ControlExtensions{
|
|
public static void InvokeSafe(this Control control, Action func){
|
|
if (control.InvokeRequired){
|
|
control.Invoke(func);
|
|
}
|
|
else{
|
|
func();
|
|
}
|
|
}
|
|
|
|
public static void SetValueInstant(this ProgressBar bar, int value){
|
|
if (value == bar.Maximum){
|
|
bar.Value = value;
|
|
bar.Value = value-1;
|
|
bar.Value = value;
|
|
}
|
|
else{
|
|
bar.Value = value+1;
|
|
bar.Value = value;
|
|
}
|
|
}
|
|
}
|
|
}
|