//------------------------------------------------------- public Word ApplyScript(Word password) { password.AppendLog("Info: ApplyScript to '{0}'\r\n", password.Text); // If thre is no code then return original password. if (string.IsNullOrEmpty(Preset.ScriptCode)) { return(password); } var language = (LanguageType)Enum.Parse(typeof(LanguageType), Preset.ScriptLanguage); if (engine == null || engine.SourceCode != Preset.ScriptCode || engine.Language != language || Preset.ScriptEntry != Preset.ScriptEntry) { engine = new Controls.DynamicCompile.DcEngine(Preset.ScriptCode, language, Preset.ScriptEntry); } var result = (string)engine.Run(this, password); if (result != null) { password.Chars = result.ToCharArray(); } return(password); }
//------------------------------------------------------- public Word ApplyScript(Word password) { password.AppendLog("Info: ApplyScript to '{0}'\r\n", password.Text); LanguageType language = (LanguageType)Enum.Parse(typeof(LanguageType), Preset.ScriptLanguage); if (engine == null || engine.SourceCode != Preset.ScriptCode || engine.Language != language || Preset.ScriptEntry != Preset.ScriptEntry) { engine = new Controls.DynamicCompile.DcEngine(Preset.ScriptCode, language, Preset.ScriptEntry); engine.CurrentAssembly = null; } string result = (string)engine.Run(this, password); if (result != null) { password.Chars = result.ToCharArray(); } return(password); }
//------------------------------------------------------- public Word ApplyScript(Word password) { password.AppendLog("Info: ApplyScript to '{0}'\r\n", password.Text); LanguageType language = (LanguageType)Enum.Parse(typeof(LanguageType), Preset.ScriptLanguage); if (engine == null || engine.SourceCode != Preset.ScriptCode || engine.Language != language || Preset.ScriptEntry != Preset.ScriptEntry) { engine = new Controls.DynamicCompile.DcEngine(Preset.ScriptCode, language, Preset.ScriptEntry); engine.CurrentAssembly = null; } string result = (string)engine.Run(this, password); if (result != null) password.Chars = result.ToCharArray(); return password; }