/// <summary> /// This method sets which type of screen is visible, login, join or main. /// </summary> public void SetupScreen(ScreenTypeEnum screenType) { // Set the new ScreenType ScreenType = screenType; // Update the UI Refresh(); // if the MainComponent exists if (screenType == ScreenTypeEnum.Main) { // if the value for HasChatComponent is true if ((HasChatComponent) && (HasLoggedInUser)) { // Create a message Message message = new Message(); // Set the Text message.Text = "Logged In User Is Set"; // Send the message to the Chat component ChatComponent.ReceiveData(message); } } }
public void SetParams(string id, string screenTypeKey, string contentTypeKey) { ScreenId = id; switch (screenTypeKey) { case "mobile": this.screenType = ScreenTypeEnum.Mobile; transform.localScale = Vector3.one * 0.2f; GetComponent <MeshRenderer>().enabled = false; break; case "static": this.screenType = ScreenTypeEnum.Static; this.gameObject.AddComponent <ScreenEnroller>(); break; } switch (contentTypeKey) { case "drawing": contentType = ContentType.Drawing; break; case "model": contentType = ContentType.Model; break; case "excel": contentType = ContentType.Excel; break; } IDLabel.text = ScreenId + "\n" + screenType + " - " + contentType; }
public static Screen CreateScreen(IScreenRender render, ScreenTypeEnum screenType, CommandModel model = null) { if (ScreenFactoryDictionary.All.ContainsKey(screenType) == false) { throw new ArgumentOutOfRangeException("screenType"); } return((Screen)Activator.CreateInstance(ScreenFactoryDictionary.All[screenType], render, model)); }
public static ScreenConfig GetConfig(TitlePanelConfig titleConfig, ScreenTypeEnum screenType, bool isMainScreen, bool isShowOnTop = false) { return(new ScreenConfig { TitleConfig = titleConfig, ScreenType = screenType, IsMainScreen = isMainScreen, ShowOnTop = isShowOnTop }); }
/// <summary> /// 识别屏幕类型 /// </summary> private void RecognizeScreenType() { var height = Screen.height; if (height < 1300) { _screenType = ScreenTypeEnum.Screen720P; } else { _screenType = ScreenTypeEnum.Screen1080P; } }
public DashboardViewModel(ScreenTypeEnum type, Plan plan) { ScreenPlan = plan; ScreenType = type; Title = plan != null ? plan.Name : AppResources.title_dashboard; Devices = new ObservableRangeCollection <Models.Device>(); LoadFavoriteCommand = new Command(async() => await ExecuteLoadFavoritesCommand(false)); RefreshFavoriteCommand = new Command(async() => await ExecuteLoadFavoritesCommand(true)); RefreshActionCommand = new Command(async() => await ExecuteLoadFavoritesCommand(false)); if (!LoadCache) { return; } OldData = true; Devices = Cache.GetCache <ObservableRangeCollection <Models.Device> >(ScreenPlan != null ? ScreenPlan.idx + ScreenType : ScreenType.ToString()) ?? new ObservableRangeCollection <Models.Device>(); LoadCache = false; }
public string GetScreenTypeName(ScreenTypeEnum screenType) { return Enum.GetName(typeof(ScreenTypeEnum), screenType); }