Exemplo n.º 1
0
        public override ProgrammingElement Clone()
        {
            NamedFilter clone = new NamedFilter(Name, NonLocalizedName);

            CopyTo(clone);
            return(clone);
        }
Exemplo n.º 2
0
        }   // RegisterInCardSpace()

        static public NamedFilter RegisterInCardSpace(string userDefinedName, string nonLocalizedName)
        {
            // Do we already have a filter with this name?
            // If so, don't try and add a new one.
            string filterUPID = "filter.named." + userDefinedName + "." + nonLocalizedName;
            Filter f;

            CardSpace.Cards.FilterDict.TryGetValue(filterUPID, out f);
            if (f != null)
            {
                return(f as NamedFilter);
            }

            NamedFilter namedFilter = new NamedFilter(userDefinedName, nonLocalizedName);

            CardSpace.Cards.FilterDict.Add(namedFilter.upid, namedFilter);

            // Look for a filter tile matching this actor's default name. If found, use its icon for this creatable tile.
            StaticActor actor      = ActorManager.GetActor(nonLocalizedName);
            string      filterName = actor.MenuTextureFile;
            string      iconName;
            Filter      filter = CardSpace.Cards.GetFilter(filterName);

            if (filter != null)
            {
                iconName = filter.TextureName;
            }
            else
            {
                iconName = namedFilter.icon;
            }

            CardSpace.Cards.CacheCardFace(namedFilter.upid, iconName, namedFilter.label, namedFilter.noLabelIcon);

            return(namedFilter);
        } // end of RegisterInCardSpace()