public Viewer(AOLHack.Domain.User user) { this.Id = user.Id; this.Name = user.Name; this.Email = user.Email; this.Type = ViewerType.Viewer; }
private void OnGUI() { GUILayout.BeginHorizontal(TableStyles.Toolbar); { _currentMode = (ViewerType)GUILayout.SelectionGrid((int)_currentMode, Enum.GetNames(typeof(ViewerType)), Enum.GetNames(typeof(ViewerType)).Length, TableStyles.ToolbarButton); } GUILayout.EndHorizontal(); Rect viewRect = new Rect(0, TableConst.TopBarHeight, position.width, position.height - TableConst.TopBarHeight); if (_currentMode == ViewerType.Texture) { _textureViewerr.Draw(viewRect, _pressedKey); } else if (_currentMode == ViewerType.Model) { _modelViewer.Draw(viewRect, _pressedKey); } else if (_currentMode == ViewerType.Particle) { _particleViewer.Draw(viewRect, _pressedKey); } else if (_currentMode == ViewerType.Shader) { _shaderViewer.Draw(viewRect, _pressedKey); } else if (_currentMode == ViewerType.Audio) { _audioViewer.Draw(viewRect, _pressedKey); } _pressedKey = KeyCode.None; }
private void MaybeInitLayer( int rendererLayer, EntityViewer bodyViewer, int viewId, ViewerType viewerType, int spriteOrder = 2 ) { var viewer = bodyViewer.Children.Find(it => it.ViewerType == viewerType); if (viewId != 0 && viewer == null) { var layerObject = new GameObject($"{viewerType}"); layerObject.layer = rendererLayer; layerObject.transform.SetParent(bodyViewer.transform, false); layerObject.transform.localPosition = Vector3.zero; var layerViewer = layerObject.AddComponent <EntityViewer>(); var sortingGroup = layerObject.AddComponent <SortingGroup>(); sortingGroup.sortingOrder = spriteOrder; layerViewer.Parent = bodyViewer; layerViewer.Entity = this; layerViewer.ViewerType = viewerType; bodyViewer.Children.Add(layerViewer); } else if (viewId == 0) { viewer?.gameObject.SetActive(false); } }
/// <summary> /// 電子報表。 /// </summary> /// <param name="name">電子報表名稱。</param> /// <param name="schoolYear">學年度。</param> /// <param name="semester">學期。</param> /// <param name="viewerType">檢視人類型。</param> public ElectronicPaper(string name, string schoolYear, string semester, ViewerType viewerType) { _name = name; _school_year = schoolYear; _semester = semester; _viewer_type = viewerType; _meta_data = new Metadata(); _papers = new List <PaperItem>(); }
public void OpenVideoViewer(ViewerType viewerType, bool showWaitingInfo) { if (this.InvokeRequired) { this.Invoke(new CbGeneric <ViewerType, bool>(this.OpenVideoViewer), viewerType, showWaitingInfo); } else { this.haveCloseVedio = false; TabPage page; if (this.tabControl1.TabPages.Count == 0) { page = new TabPage("视频"); this.tabControl1.TabPages.Add(page); } else { page = this.tabControl1.TabPages[0]; (page.Controls[0] as IViewer).Close(); page.Controls.Clear(); this.Width = this.Width - this.panel_plus.Width; } switch (viewerType) { case ViewerType.VideoRequest: { VideoRequestViewer videoRequestViewer = new VideoRequestViewer(); videoRequestViewer.Dock = System.Windows.Forms.DockStyle.Fill; videoRequestViewer.ReceiveVideo += new CbGeneric(videoRequestViewer_ReceiveVideo); videoRequestViewer.RejectVideo += new CbGeneric(videoRequestViewer_RejectVideo); page.Controls.Add(videoRequestViewer); this.currentViewer = videoRequestViewer; this.panel_plus.Visible = true; int screenWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; this.Width = this.Width + 224 > screenWidth ? screenWidth : this.Width + 224; this.panel_plus.Width = 224; break; } case ViewerType.VideoView: { videoViewer = new VideoViewer(userName, friendName, showWaitingInfo, this.multimediaManager); videoViewer.CloseVideo += new CbGeneric(videoViewer_CloseVideo); videoViewer.OfflineCloseVideo += new CbGeneric(videoViewer_OfflineCloseVideo); page.Controls.Add(videoViewer); this.panel_plus.Visible = true; int screenWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width; this.Width = this.Width + 346 > screenWidth ? screenWidth : this.Width + 346; this.panel_plus.Width = 346; this.currentViewer = videoViewer; break; } } this.haveVideo = true; } }
private void ShowViewer(InvItemClient invItem, int rowId, string header, ViewerType docViewerType) { if (rowId == 0) { return; } var newDocumentViewer = new DocumentViewerWindow(api, header); newDocumentViewer.DocumentViewerType = docViewerType; newDocumentViewer.InitViewer(invItem); newDocumentViewer.Show(); }
public Status getViewerTypeStatus(ViewerType type, Feature feature) { Viewer viewer = getViewerByFeature(feature); if (type == ViewerType.DESKTOP) { return (viewer.desktop == "1") ? Status.ENABLED : Status.DISABLED; } else if (type == ViewerType.MOBILE) { return (viewer.mobile == "1") ? Status.ENABLED : Status.DISABLED; } else if (type == ViewerType.TABLET) { return (viewer.tablet == "1") ? Status.ENABLED : Status.DISABLED; } return Status.DISABLED; }
/// <summary> /// Create base TripDetailsViewModelCreator and wrap it with decorators which depend on viewer type. /// </summary> /// <param name="viewerType">Type of viewer</param> /// <returns></returns> public ITripDetailsCreator CreateCreator(ViewerType viewerType) { var ret = (ITripDetailsCreator)provider.GetService(typeof(ITripDetailsCreator)); // if (viewerType != ViewerType.Guest) // { ret = new PassengerListDecorator(ret); // } if (viewerType == ViewerType.Driver) { ret = new RequestListDecorator(ret); } ret = new MapDecorator(ret); return(ret); }
public Status getViewerTypeStatus(ViewerType type, Feature feature) { Viewer viewer = getViewerByFeature(feature); if (type == ViewerType.DESKTOP) { return((viewer.desktop == "1") ? Status.ENABLED : Status.DISABLED); } else if (type == ViewerType.MOBILE) { return((viewer.mobile == "1") ? Status.ENABLED : Status.DISABLED); } else if (type == ViewerType.TABLET) { return((viewer.tablet == "1") ? Status.ENABLED : Status.DISABLED); } return(Status.DISABLED); }
private void SetViewerType(ViewerType type, bool autoSave) { bool isCompact = type == ViewerType.CompactThumbnail; bool isThumbnail = type == ViewerType.Thumbnail; bool isSingle = type == ViewerType.Single; SetChecked(barButtonItemCompactThumbnailView, isCompact); SetChecked(barButtonItemThumbnailView, isThumbnail); SetChecked(barButtonItemSingleView, isSingle); SetVisible(barButtonItemZoom, isSingle); SetVisible(barButtonItemPan, isSingle); SetVisible(barButtonItemDrawZone, isSingle && barButtonItemIndexing.Down); SetVisible(barButtonItemPageFit, isSingle); SetVisible(barButtonItemHorizontalFit, isSingle); SetVisible(barButtonItemVerticalFit, isSingle); SetVisible(barButtonItem100View, isSingle); ribbonStatusBar.Refresh(); if (autoSave) appSetting.CurrentViewType = type; }
/// <summary> /// Creates minimal ViewModel depend on <paramref name="viewerType"/>. See current configured factory for exact implementation /// </summary> /// <param name="tripId">TripDetail id</param> /// <param name="viewerType">Type of viewer</param> /// <returns>viewmodel</returns> public TripDetailsViewModel GetViewModel(int tripId, ViewerType viewerType) { var dataModel = detailsRepository.GetTripWithPassengersById(tripId); return(factory.CreateCreator(viewerType).CreateViewModel(dataModel)); }
public List <TripDetailsViewModel> Convert(IEnumerable <TripDetails> dataModels, ViewerType type) { var creator = factory.CreateCreator(type); var ret = new List <TripDetailsViewModel>(); foreach (var dataModel in dataModels) { ret.Add(creator.CreateViewModel(dataModel)); } return(ret); }
public static Viewer GetViewerByTypeAndUsername(string username, ViewerType viewerType) { return(All.Find(s => s.ViewerType == viewerType && s.Username == username)); }
#pragma warning restore CA1822 // Mark members as static public void ShowViewer(ViewerType viewerType) { this.Clear(false, false); this.presenter.ViewerType = viewerType; }
public void ShowViewer(ViewerType viewerType) { Clear(false, false); _presenter.ViewerType = viewerType; }