Beispiel #1
0
 public Viewer(AOLHack.Domain.User user)
 {
     this.Id    = user.Id;
     this.Name  = user.Name;
     this.Email = user.Email;
     this.Type  = ViewerType.Viewer;
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
    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>();
 }
Beispiel #5
0
        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;
            }
        }
Beispiel #6
0
        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();
        }
Beispiel #7
0
 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;
 }
Beispiel #8
0
        /// <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);
        }
Beispiel #9
0
        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;
 }
Beispiel #11
0
        /// <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));
        }
Beispiel #12
0
        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);
        }
Beispiel #13
0
 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;
        }
Beispiel #15
0
 public void ShowViewer(ViewerType viewerType)
 {
     Clear(false, false);
     _presenter.ViewerType = viewerType;
 }