internal void Update(RykonLang r) { this.CompilerPath = r.CompilerPath; this.Enabled = r.Enabled; this.FileExts = r.FileExts; this.LangName = r.LangName; this.LangVersion = r.LangVersion; this.ProcessArgs = r.ProcessArgs; }
public FrmLanguageAdd(RykonLang _lang_) { InitializeComponent(); TxbxCompilerPath.Text = _lang_.CompilerPath; TxbxName.Text = _lang_.LangName; TxbxArgs.Text = _lang_.ProcessArgs; txbxVersion.Text = _lang_.LangVersion; }
internal void Update(RykonLang r) { this.CompilerPath = r.CompilerPath; this.Enabled = r.Enabled; this.FileExts = r.FileExts; this.LangName = r.LangName; this.LangVersion = r.LangVersion; this.ProcessArgs = r.ProcessArgs; this.DecodeDataBeforeEnvironment = r.DecodeDataBeforeEnvironment; }
internal void AddLanguage(Classes.RykonLang r) { int count = -1; foreach (RykonLang rl in this.LanguageList) { count++; if (rl.IsMatch(r)) { this.LanguageList[count].Update(r); return; } } this.LanguageList.Add(r); }
internal static RykonLang Build(string lang, string AttSeparator, string ValSeparator) { // name=php AttSeparator path=c:\php AttSeparator version=3 AttSeparator arg=d RykonLang r = new RykonLang(); if (lang.Contains(AttSeparator)) { string[] attrs = lang.Split(new string[] { AttSeparator }, StringSplitOptions.RemoveEmptyEntries); foreach (string x in attrs) { string name = "", val = ""; if (x.Contains(ValSeparator)) { string [] pcs = x.Split(new string[] { ValSeparator }, StringSplitOptions.RemoveEmptyEntries); name = pcs[0].Trim(); } r.SetATrrAndVal(name, val); } } return(r); }
private bool SaveLangs() { RykonLang SelectedLanguage = new RykonLang(); SelectedLanguage.LangName = txbxLangName.Text; if (SelectedLanguage.LangName.Length < 2) { SetStatue("language should has a name"); return false; } SelectedLanguage.ProcessArgs = txbxLangArgs.Text; if (SelectedLanguage.LangName.Length < 2) SetStatue("Be careful no args for this compiler"); SelectedLanguage.CompilerPath = txbxLangPath.Text; if(!AppHelper.IsFileExist (SelectedLanguage.CompilerPath)) { SetStatue("language should has available compiler"); return false; } SelectedLanguage.LangVersion = txbxLangVer.Text; if (SelectedLanguage.LangName.Length < 1) { SetStatue("Language version unknown , i assigned a 1 for default"); SelectedLanguage.LangVersion = "1"; } SelectedLanguage.InitExts(lstbxExts.Items); if (SelectedLanguage.FileExts.Count < 1) { SetStatue("language should has at least one file extension"); return false; } EmptyLangsFields(false); lstbxExts.Items.Clear(); this._MainCompiler_.AddLanguage(SelectedLanguage); txbxLangName.Text = txbxLangArgs.Text = txbxLangPath.Text = txbxLangVer.Text = ""; lstbxExts.Items.Clear(); SetStatue("upated"); _MainCompiler_.Save(); LoadLanguages(false); cmbxLangs.SelectedIndex = -1; cmbxLangs.SelectedIndex = cmbxLangs.Items.Count-1; return true; }
internal void Update(RykonLang r) { this.CompilerPath = r.CompilerPath; this.Enabled = r.Enabled; this.FileExts = r.FileExts; this.LangName = r.LangName; this.LangVersion = r.LangVersion; this.ProcessArgs = r.ProcessArgs; this.DecodeDataBeforeEnvironment = r.DecodeDataBeforeEnvironment; }
internal bool IsMatch(RykonLang r) { return (this.CompilerPath.Trim() == r.CompilerPath.Trim()); }
internal static RykonLang Build(string lang) { // name=php AttSeparator path=c:\php AttSeparator version=3 AttSeparator arg=d RykonLang r = new RykonLang(); if (lang.Contains(RykonLang.Langs_ATTR_Separator.ToString())) { string[] attrs = lang.Split(Langs_ATTR_Separator);//new string[] { AttSeparator }, StringSplitOptions.RemoveEmptyEntries); foreach (string x in attrs) { string name = "", val = ""; if (x.Contains(RykonLang.Langs_VAL_Separator.ToString())) { string[] pcs = x.Split(RykonLang.Langs_VAL_Separator); name = pcs[0].Trim(); val = pcs[1].Trim(); } r.SetATrrAndVal(name, val); } } return r; }
internal bool IsMatch(RykonLang r) { return(this.CompilerPath.Trim() == r.CompilerPath.Trim()); }