コード例 #1
0
        private TwitterViewModel GetTwitterSetting(SettingViewModel setting)
        {
            TwitterViewModel twitter = null;
            if (setting.value != null)
            {
                twitter = JsonConvert.DeserializeObject<TwitterViewModel>(setting.value);
            }
            else
            {
                twitter = new TwitterViewModel()
                {
                    id = setting.id,
                    alias = setting.alias,
                    name = setting.name
                };
            }

            return twitter;
        }
コード例 #2
0
        private FacebookViewModel GetFBSetting(SettingViewModel setting)
        {
            FacebookViewModel fb = null;
            if (setting.value != null)
            {
                fb = JsonConvert.DeserializeObject<FacebookViewModel>(setting.value);
            }
            else
            {
                fb = new FacebookViewModel()
                {
                    id = setting.id,
                    alias = setting.alias,
                    name = setting.name
                };
            }

            return fb;
        }
コード例 #3
0
        private InstagramViewModel GetIGSetting(SettingViewModel setting)
        {
            InstagramViewModel ig = null;
            if(setting.value != null)
            {
                ig = JsonConvert.DeserializeObject<InstagramViewModel>(setting.value);
            }
            else
            {
                ig = new InstagramViewModel()
                {
                    id = setting.id,
                    alias = setting.alias,
                    name = setting.name
                };
            }

            return ig;
        }
コード例 #4
0
        private EmailSettingViewModel GetEmailSetting(SettingViewModel setting)
        {
            EmailSettingViewModel email = null;
            if (setting.value != null)
            {
                email = JsonConvert.DeserializeObject<EmailSettingViewModel>(setting.value);
            }
            else
            {
                email = new EmailSettingViewModel()
                {
                    id = setting.id,
                    alias = setting.alias,
                    name = setting.name
                };
            }

            return email;
        }