예제 #1
0
    public void Set(float duration, float targetY, UISkin skin)
    {
        if (!scroll)
        {
            scroll = GetComponent <ScrollRect>();
        }

        time          = scroll.verticalNormalizedPosition != targetY ? 0 : 1;
        sourceY       = scroll.verticalNormalizedPosition;
        this.duration = duration;
        this.targetY  = targetY;
        this.skin     = skin;

        enabled = true;
    }
예제 #2
0
    public bool SetSkinByName(string name)
    {
        bool ret = false;

        foreach (UISkin s in availableSkins)
        {
            if (s.name == name)
            {
                ret  = true;
                skin = s;
                UpdateSkinSettings();
                break;
            }
        }

        return(ret);
    }
예제 #3
0
        protected override void LoadContent()
        {
            var contents = new AppContents();

            contents.LoadContent(Content);

            _screenManager.Store.Add("AppContents", contents);

            var skin = new UISkin(contents.DefaultFont);

            skin.SetValue <Label, Color>(l => l.Color, AppColors.MenuItems);
            skin.SetValue <Label, Color>(l => l.ColorHovered, AppColors.MenuItemsHover);

            _screenManager.Store.Add("UISkin", skin);

            _screenManager.Dependencies.GetService <ISoundsManager>()
            .LoadContent(Content);

            base.LoadContent();
        }
예제 #4
0
        protected void initGameObject(GameObject obj)
        {
            gameObject = obj;
            transform  = obj.transform;
            Normalize();
            rectTransform = obj.GetComponent <RectTransform>();
            UIOutlet uiInfo = obj.GetComponent <UIOutlet>();
            UISkin   uiskin = obj.GetComponent <UISkin>();

            for (int i = 0; i < uiInfo.OutletInfos.Count; i++)
            {
                objectList.Add(uiInfo.OutletInfos[i].Name, uiInfo.OutletInfos[i].Object as GameObject);
            }
            gameObject.SetActive(m_isActive);
            gameObject.SetVisible(m_isVisible);
            isInstance = true;
            InitializeComponent();
            Initialize();
            InitializeSkin();
            Awake();
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="skinID"></param>
        public void SetCurrentSkin(decimal skinID)
        {
            try
            {
                EntityRepository <UISkin> skinRep = new EntityRepository <UISkin>(false);
                UserRepository            rep     = new UserRepository(false);
                User   user = rep.GetByUserName(this.CurrentUser);
                UISkin skin = skinRep.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new UISkin().ID), skinID)).FirstOrDefault();
                if (skin != null && user != null)
                {
                    UserSettings userSetings = userSettingRep.GetByCriteria(new CriteriaStruct(Utility.GetPropertyName(() => new UserSettings().User), user)).FirstOrDefault();
                    if (userSetings != null)
                    {
                        userSetings.Skin = skin;
                        userSettingRep.Update(userSetings);
                    }
                    else
                    {
                        userSetings          = new UserSettings();
                        userSetings.Skin     = skin;
                        userSetings.User     = user;
                        userSetings.Language = BLanguage.GetCurrentSystemLanguage();
                        userSettingRep.Save(userSetings);
                    }
                    SessionHelper.ClearSessionValue(SessionHelper.BussinessLocalSkinSessionName);
                }
                else
                {
                    throw new InvalidDatabaseStateException(UIFatalExceptionIdentifiers.UserSettingsSkinOrUserNotExsists, "پوسته یا کاربر در دیتابیس موجود نمیباشد", "GTS.Clock.Business.AppSettings.LanguageProvider.SetCurrentSkin");
                }
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BUserSettings", "SetCurrentSkin");

                throw ex;
            }
        }