public override void SetValue(object component, object value)
        {
            oneProperty.SetValue(component, value);
            if (!(component is BackgroundParam) || !("m_imageFilePath" == oneProperty.Name))
            {
                return;
            }
            string text     = value as string;
            bool   readOnly = false;

            if (text == null || text.Length == 0)
            {
                BackgroundParam backgroundParam = component as BackgroundParam;
                backgroundParam.m_fontShadow = OnOffType.On;
                backgroundParam.m_fontColor  = Color.White;
                readOnly = true;
            }
            if (oneCollection == null)
            {
                return;
            }
            foreach (PropertyDescriptor item in oneCollection)
            {
                PropertyDisplayPropertyDescriptor propertyDisplayPropertyDescriptor = item as PropertyDisplayPropertyDescriptor;
                if ("m_fontColor" == propertyDisplayPropertyDescriptor.Name || "m_fontShadow" == propertyDisplayPropertyDescriptor.Name)
                {
                    propertyDisplayPropertyDescriptor.m_readOnly = readOnly;
                }
            }
        }
Esempio n. 2
0
 public HomeProperty()
 {
     for (int i = 0; i < m_bgParam_.Length; i++)
     {
         m_bgParam_[i] = new BackgroundParam(i);
     }
     MainForm.m_mainForm.homeBgPictureBox1.ImageLocation = null;
     MainForm.m_mainForm.homeBgPictureBox1.Image         = null;
     MainForm.m_mainForm.homePictureBox1.Image           = BackgroundParam.s_waveImage[1];
     m_browser     = new IconParam(MainForm.m_mainForm.browserIcon, MainForm.m_mainForm.browserLabel, null);
     m_video       = new IconParam(MainForm.m_mainForm.videoIcon, MainForm.m_mainForm.videoLabel, null);
     m_music       = new IconParam(MainForm.m_mainForm.musicIcon, MainForm.m_mainForm.musicLabel, null);
     m_ps3Link     = new IconParam(MainForm.m_mainForm.ps3LinkIcon, MainForm.m_mainForm.ps3LinkLabel, null);
     m_party       = new IconParam(MainForm.m_mainForm.partyIcon, MainForm.m_mainForm.partyLabel, null);
     m_trophy      = new IconParam(MainForm.m_mainForm.trophyIcon, MainForm.m_mainForm.trophyLabel, null);
     m_near        = new IconParam(MainForm.m_mainForm.nearIcon, MainForm.m_mainForm.nearLabel, null);
     m_hostCollabo = new IconParam(MainForm.m_mainForm.hostCollaboIcon, MainForm.m_mainForm.hostCollaboLabel, null);
     m_welcomePark = new IconParam(MainForm.m_mainForm.welcomeParkIcon, MainForm.m_mainForm.welcomeParkLabel, null);
     m_ps4Link     = new IconParam(MainForm.m_mainForm.ps4LinkIcon, MainForm.m_mainForm.ps4LinkLabel, null);
     m_friend      = new IconParam(MainForm.m_mainForm.friendIcon, MainForm.m_mainForm.friendLabel, null);
     m_email       = new IconParam(MainForm.m_mainForm.emailIcon, MainForm.m_mainForm.emailLabel, MainForm.m_mainForm.notificationEmailIcon);
     m_calendar    = new IconParam(MainForm.m_mainForm.calendarIcon, MainForm.m_mainForm.calendarLabel, MainForm.m_mainForm.notificationCalendarIcon);
     m_store       = new IconParam(MainForm.m_mainForm.storeIcon, MainForm.m_mainForm.storeLabel, null);
     m_message     = new IconParam(MainForm.m_mainForm.messageIcon, MainForm.m_mainForm.messageLabel, MainForm.m_mainForm.notificationMessageIcon);
     m_parental    = new IconParam(MainForm.m_mainForm.parentalIcon, MainForm.m_mainForm.parentalLabel, null);
     m_camera      = new IconParam(MainForm.m_mainForm.cameraIcon, MainForm.m_mainForm.cameraLabel, null);
     m_settings    = new IconParam(MainForm.m_mainForm.settingsIcon, MainForm.m_mainForm.settingsLabel, null);
     m_power       = new IconParam(MainForm.m_mainForm.powerIcon, MainForm.m_mainForm.powerLabel, null);
     resetLayout();
 }
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object instance, Attribute[] filters)
        {
            PropertyDescriptorCollection propertyDescriptorCollection = new PropertyDescriptorCollection(null);
            PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(instance, filters, true);

            foreach (PropertyDescriptor item in properties)
            {
                if (instance is BackgroundParam)
                {
                    if ("m_fontColor" == item.Name || "m_fontShadow" == item.Name)
                    {
                        BackgroundParam backgroundParam = instance as BackgroundParam;
                        if (backgroundParam.m_imageFilePath == null || backgroundParam.m_imageFilePath.Length == 0)
                        {
                            propertyDescriptorCollection.Add(new PropertyDisplayPropertyDescriptor(item, propertyDescriptorCollection, true));
                        }
                        else
                        {
                            propertyDescriptorCollection.Add(new PropertyDisplayPropertyDescriptor(item, propertyDescriptorCollection));
                        }
                    }
                    else
                    {
                        propertyDescriptorCollection.Add(new PropertyDisplayPropertyDescriptor(item, propertyDescriptorCollection));
                    }
                }
                else if (MainForm.m_mainForm.m_package == Package.Normal)
                {
                    if (!("m_store" == item.DisplayName) && !("m_welcomePark" == item.DisplayName) && !("m_map" == item.DisplayName) && !("m_iconPos" == item.DisplayName) && !("m_pagePos" == item.DisplayName))
                    {
                        propertyDescriptorCollection.Add(new PropertyDisplayPropertyDescriptor(item));
                    }
                }
                else if (Package.VitaPreInstall == MainForm.m_mainForm.m_package && !("m_power" == item.DisplayName))
                {
                    propertyDescriptorCollection.Add(new PropertyDisplayPropertyDescriptor(item));
                }
            }
            m_collection = propertyDescriptorCollection;
            return(propertyDescriptorCollection);
        }