public AppEntity(string appName, string executePath) { AppName = appName; ExecutePath = executePath; PictureBox = new TransparentPictureBox() { Name = AppName, Image = Icon.ExtractAssociatedIcon(executePath).ToBitmap(), }; PictureBox.SizeMode = PictureBoxSizeMode.StretchImage; SetSize(PictureBox.Image.Size); }
public AppEntity(AppEntityJson appJson) { AppName = appJson.AppName; ExecutePath = appJson.ExecutePath; IsLoggingActive = appJson.IsLoggingActive; Logger = new Logger(appJson.LoggerPath); PictureBox = new TransparentPictureBox() { Name = AppName, Image = Icon.ExtractAssociatedIcon(ExecutePath).ToBitmap(), }; if (appJson.IsSelected) { Select(); } else { Unselect(); } PictureBox.SizeMode = PictureBoxSizeMode.StretchImage; SetSize(PictureBox.Image.Size); }