Example #1
0
        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);
        }
Example #2
0
        private static void CacheTemplate(ITemplate tpl)
        {
            string key = tpl.ToFilename();

            if (mCache.ContainsKey(key) == true)
            {
                mCache[key] = tpl;
                return;
            }
            mCache.Add(key, tpl);
        }
Example #3
0
        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);
        }
Example #4
0
		private static void CacheTemplate( ITemplate tpl ) {
			string key = tpl.ToFilename();
			if( mCache.ContainsKey( key ) == true ) {
				mCache[ key ] = tpl;
				return;
			}
			mCache.Add( key, tpl );
		}
Example #5
0
		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;
		}
Example #6
0
		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;
		}