private static string GetTemplatePath(EItemType Type, ITemplate Template) { string path = ""; switch (Type) { default: throw new Exception("Unknown EItemType! Can't setup TemplatePath"); case EItemType.Waffe: path = DirWeapon; break; case EItemType.Rüstung: path = DirArmor; break; case EItemType.Lapis: path = DirLapis; break; case EItemType.APItem: path = DirApItem; break; case EItemType.EtcItem: path = DirEtc; break; } path += Template.ToFilename(); return(path); }
private static void CacheTemplate(ITemplate tpl) { string key = tpl.ToFilename(); if (mCache.ContainsKey(key) == true) { mCache[key] = tpl; return; } mCache.Add(key, tpl); }
private static ToolStripMenuItem BuildMenuItem(string Filename, ITemplate tpl, EventHandler OnClick) { ToolStripMenuItem item = new ToolStripMenuItem(); item.Text = tpl.ToName(); item.AutoSize = true; item.Tag = tpl.ToFilename(); // to fetch it later back from Cache, saved with ToFilename() item.Click += OnClick; return(item); }
private static void CacheTemplate( ITemplate tpl ) { string key = tpl.ToFilename(); if( mCache.ContainsKey( key ) == true ) { mCache[ key ] = tpl; return; } mCache.Add( key, tpl ); }
private static string GetTemplatePath( EItemType Type, ITemplate Template ) { string path = ""; switch( Type ) { default: throw new Exception( "Unknown EItemType! Can't setup TemplatePath" ); case EItemType.Waffe: path = DirWeapon; break; case EItemType.Rüstung: path = DirArmor; break; case EItemType.Lapis: path = DirLapis; break; case EItemType.APItem: path = DirApItem; break; case EItemType.EtcItem: path = DirEtc; break; } path += Template.ToFilename(); return path; }
private static ToolStripMenuItem BuildMenuItem( string Filename, ITemplate tpl, EventHandler OnClick ) { ToolStripMenuItem item = new ToolStripMenuItem(); item.Text = tpl.ToName(); item.AutoSize = true; item.Tag = tpl.ToFilename(); // to fetch it later back from Cache, saved with ToFilename() item.Click += OnClick; return item; }