Esempio n. 1
0
        protected override void Load()
        {
            string attribute1       = this.XmlElement.GetAttribute("Title");
            int    stringResourceId = MediaCenterUtil.GetMagicStringResourceID(attribute1);

            if (stringResourceId >= 0)
            {
                string stringResource = ResourceExtensions.GetStringResource(this.Manager.Resources["ehres.dll"], stringResourceId);
                if (stringResource != null)
                {
                    this.originalTitle = stringResource;
                }
            }
            if (this.originalTitle == null)
            {
                this.originalTitle = attribute1;
            }
            this.Title = this.originalTitle;
            string attribute2 = this.XmlElement.GetAttribute("Icon");

            this.images = ((DefaultStartMenuManager)this.Manager).GetImages(attribute2);
            if (this.images == null)
            {
                throw new ApplicationException("Could not find image set \"" + attribute2 + "\".");
            }
            this.SetValue(XmlQuickLink.ImageProperty, (object)this.images["Focus"]);
            this.SetValue(XmlQuickLink.NonFocusImageProperty, (object)this.images["Default"]);
            string attribute3 = this.XmlElement.GetAttribute("Visible");
            bool   result;

            this.IsEnabled       = string.IsNullOrEmpty(attribute3) || bool.TryParse(attribute3, out result) && result;
            this.originalStripID = this.XmlElement.GetAttribute("AppId");
            this.originalStrip   = (DefaultMenuStrip)null;
        }
Esempio n. 2
0
 protected override void Load()
 {
     string attribute1 = this.XmlElement.GetAttribute("Title");
     int stringResourceId = MediaCenterUtil.GetMagicStringResourceID(attribute1);
     if (stringResourceId >= 0)
     {
         string stringResource = ResourceExtensions.GetStringResource(this.Manager.Resources["ehres.dll"], stringResourceId);
         if (stringResource != null)
             this.originalTitle = stringResource;
     }
     if (this.originalTitle == null)
         this.originalTitle = attribute1;
     this.Title = this.originalTitle;
     string attribute2 = this.XmlElement.GetAttribute("Icon");
     this.images = ((DefaultStartMenuManager)this.Manager).GetImages(attribute2);
     if (this.images == null)
         throw new ApplicationException("Could not find image set \"" + attribute2 + "\".");
     this.SetValue(XmlQuickLink.ImageProperty, (object)this.images["Focus"]);
     this.SetValue(XmlQuickLink.NonFocusImageProperty, (object)this.images["Default"]);
     string attribute3 = this.XmlElement.GetAttribute("Visible");
     bool result;
     this.IsEnabled = string.IsNullOrEmpty(attribute3) || bool.TryParse(attribute3, out result) && result;
     this.originalStripID = this.XmlElement.GetAttribute("AppId");
     this.originalStrip = (DefaultMenuStrip)null;
 }