示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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 );
		}
示例#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;
		}
示例#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;
		}