Ejemplo n.º 1
0
        private void setButtonStates()
        {
            ShowFilter filter = TVSettings.Instance.Filter;

            if (filter != null)
            {
                //Filter By Show Names
                Boolean filterByShowNames = filter.ShowName != null;
                tbShowName.Text = (filterByShowNames ? filter.ShowName : "");

                //Filter By Show Status
                Boolean filterByShowStatus = filter.ShowStatus != null;
                cmbShowStatus.SelectedItem = (filterByShowStatus ? filter.ShowStatus : "");

                //Filter By Show Rating
                Boolean filterByShowRating = filter.ShowRating != null;
                cmbRating.SelectedItem = (filterByShowRating ? filter.ShowRating : "");

                //Filter By Show Network
                Boolean filterByShowNetwork = filter.ShowNetwork != null;
                cmbNetwork.SelectedItem = (filterByShowNetwork ? filter.ShowNetwork : "");


                //Filter By Genre
                foreach (String genre in filter.Genres)
                {
                    int genre_index = clbGenre.Items.IndexOf(genre);
                    clbGenre.SetItemChecked(genre_index, true);
                }
            }
        }
Ejemplo n.º 2
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            ShowFilter filter = TVSettings.Instance.Filter;

            filter.ShowName    = string.IsNullOrEmpty(tbShowName.Text) ? null : tbShowName.Text;
            filter.ShowStatus  = string.IsNullOrEmpty(cmbShowStatus.Text) ? null : cmbShowStatus.SelectedItem.ToString();
            filter.ShowNetwork = string.IsNullOrEmpty(cmbNetwork.Text) ? null : cmbNetwork.SelectedItem.ToString();
            filter.ShowRating  = string.IsNullOrEmpty(cmbRating.Text) ? null : cmbRating.SelectedItem.ToString();

            filter.ShowStatusInclude  = GetIncludeStatus(cmbShowStatusType);
            filter.ShowNetworkInclude = GetIncludeStatus(cmbNetworkType);
            filter.ShowRatingInclude  = GetIncludeStatus(cmbRatingType);

            filter.Genres.Clear();
            foreach (string genre in clbGenre.CheckedItems)
            {
                filter.Genres.Add(genre);
            }

            SeasonFilter sFilter = TVSettings.Instance.SeasonFilter;

            sFilter.HideIgnoredSeasons = chkHideIgnoredSeasons.Checked;

            doc.SetDirty();
            DialogResult = DialogResult.OK;
            Close();
        }
Ejemplo n.º 3
0
        private void SetButtonStates()
        {
            ShowFilter filter = TVSettings.Instance.Filter;
            {
                //Filter By Show Names
                bool filterByShowNames = filter.ShowName != null;
                tbShowName.Text = filterByShowNames ? filter.ShowName : string.Empty;

                //Filter By Show Status
                bool filterByShowStatus = filter.ShowStatus != null;
                cmbShowStatus.SelectedItem = filterByShowStatus ? filter.ShowStatus : string.Empty;

                //Filter By Show Rating
                bool filterByShowRating = filter.ShowRating != null;
                cmbRating.SelectedItem = filterByShowRating ? filter.ShowRating : string.Empty;

                //Filter By Show Network
                bool filterByShowNetwork = filter.ShowNetwork != null;
                cmbNetwork.SelectedItem = filterByShowNetwork ? filter.ShowNetwork : string.Empty;

                //Filter By Show Status
                cmbShowStatusType.SelectedItem = filter.ShowStatusInclude ? IS : IS_NOT;

                //Filter By Show Rating
                cmbRatingType.SelectedItem = filter.ShowRatingInclude ? IS : IS_NOT;

                //Filter By Show Network
                cmbNetworkType.SelectedItem = filter.ShowNetworkInclude ? IS : IS_NOT;

                //Filter By Genre
                foreach (string genre in filter.Genres)
                {
                    int genreIndex = clbGenre.Items.IndexOf(genre);
                    if (genreIndex > 0)
                    {
                        clbGenre.SetItemChecked(genreIndex, true);
                    }
                }
            }

            SeasonFilter sFilter = TVSettings.Instance.SeasonFilter;

            chkHideIgnoredSeasons.Checked = sFilter.HideIgnoredSeasons;
        }
Ejemplo n.º 4
0
        private async Task LoadReportAsync()
        {
            if (Uri.TryCreate(EmbedUrl, UriKind.Absolute, out Uri embedUri))
            {
                string token = await GetUserTokenAsync();

                if (!string.IsNullOrEmpty(token) &&
                    embedUri.Query.IndexOf("reportid", StringComparison.OrdinalIgnoreCase) != -1 &&
                    embedUri.Query.IndexOf("groupid", StringComparison.OrdinalIgnoreCase) != -1)
                {
                    var tokenCredentials = new TokenCredentials(token, "Bearer");

                    using (var client = new PowerBIClient(new Uri(ApiUrl), tokenCredentials))
                    {
                        var    decoder  = new WwwFormUrlDecoder(embedUri.Query.ToLower());
                        string groupId  = decoder.GetFirstValueByName("groupid");
                        string reportId = decoder.GetFirstValueByName("reportid");

                        Report report = await client.Reports.GetReportAsync(groupId, reportId);

                        if (report != null)
                        {
                            InvokeScriptAsync($"loadGroups(" +
                                              $"'{token}', " +
                                              $"{JsonConvert.SerializeObject(new Report[] { report })}, " +
                                              $"{JsonConvert.SerializeObject(report)}, " +
                                              (IsWindowsPhone ? $"'{DisplayInformation.CurrentOrientation.ToString()}'," : "'', ") +
                                              $"{ShowFilter.ToString().ToLower()}" +
                                              ")");

                            return;
                        }
                    }
                }

                ClearReport();
            }
            else
            {
                throw new ArgumentException(nameof(EmbedUrl));
            }
        }
Ejemplo n.º 5
0
        public ActionResult Index(ShowFilter iLibraryFilter = ShowFilter.all)
        {
            List<TvShowsBySeason> ShowsBySeason = new List<TvShowsBySeason>();

            foreach (var s in ItunesCache.TvShows) {
                ShowsBySeason.Add(new TvShowsBySeason() {
                    ShowName = s.Name,
                    SeasonNumber = s.Season,
                    TotalEpisodes = s.Episodes.Count,
                    UnwatchedEpisodes = s.Episodes.Where(e => e.PlayCount < 1).Count(),
                    PostArtPath = s.PosterArtPath
                });
            }

            if (iLibraryFilter == ShowFilter.unwatched) {
                return View(ShowsBySeason.Where(s => s.UnwatchedEpisodes > 0).ToList());
            }

            return View(ShowsBySeason);
        }
Ejemplo n.º 6
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            ShowFilter filter = TVSettings.Instance.Filter;

            //Filter By Show Name

            filter.ShowName    = String.IsNullOrEmpty(tbShowName.Text) ? null : tbShowName.Text;
            filter.ShowStatus  = String.IsNullOrEmpty(cmbShowStatus.Text) ? null : cmbShowStatus.SelectedItem.ToString();
            filter.ShowNetwork = String.IsNullOrEmpty(cmbNetwork.Text) ? null : cmbNetwork.SelectedItem.ToString();
            filter.ShowRating  = String.IsNullOrEmpty(cmbRating.Text) ? null : cmbRating.SelectedItem.ToString();

            filter.Genres.Clear();
            foreach (String genre in clbGenre.CheckedItems)
            {
                filter.Genres.Add(genre);
            }

            this.doc.SetDirty();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Ejemplo n.º 7
0
        private async Task LoadGroupAsync()
        {
            string token = await GetUserTokenAsync();

            if (!string.IsNullOrEmpty(token))
            {
                var tokenCredentials = new TokenCredentials(token, "Bearer");

                using (var client = new PowerBIClient(new Uri(ApiUrl), tokenCredentials))
                {
                    IList <Report> reports         = (await client.Reports.GetReportsAsync(GroupId))?.Value;
                    Report         selectionReport = null;

                    if (reports.Count > 0)
                    {
                        Report findReport = reports.Where(
                            i => i.EmbedUrl.Equals(
                                EmbedUrl,
                                StringComparison.OrdinalIgnoreCase))
                                            .FirstOrDefault();

                        selectionReport = findReport ?? reports.First();
                    }

                    InvokeScriptAsync($"loadGroups(" +
                                      $"'{token}', " +
                                      $"{JsonConvert.SerializeObject(reports)}, " +
                                      $"{JsonConvert.SerializeObject(selectionReport)}, " +
                                      (IsWindowsPhone ? $"'{DisplayInformation.CurrentOrientation.ToString()}'," : "'', ") +
                                      $"{ShowFilter.ToString().ToLower()}" +
                                      ")");
                }
            }
            else
            {
                ClearReport();
            }
        }
Ejemplo n.º 8
0
        private void SetButtonStates()
        {
            ShowFilter filter = TVSettings.Instance.Filter;

            if (filter != null)
            {
                //Filter By Show Names
                bool filterByShowNames = filter.ShowName != null;
                tbShowName.Text = filterByShowNames ? filter.ShowName : "";

                //Filter By Show Status
                bool filterByShowStatus = filter.ShowStatus != null;
                cmbShowStatus.SelectedItem = filterByShowStatus ? filter.ShowStatus : "";

                //Filter By Show Rating
                bool filterByShowRating = filter.ShowRating != null;
                cmbRating.SelectedItem = filterByShowRating ? filter.ShowRating : "";

                //Filter By Show Network
                bool filterByShowNetwork = filter.ShowNetwork != null;
                cmbNetwork.SelectedItem = filterByShowNetwork ? filter.ShowNetwork : "";

                //Filter By Genre
                foreach (string genre in filter.Genres)
                {
                    int genreIndex = clbGenre.Items.IndexOf(genre);
                    clbGenre.SetItemChecked(genreIndex, true);
                }
            }

            SeasonFilter sFilter = TVSettings.Instance.SeasonFilter;

            if (sFilter != null)
            {
                chkHideIgnoredSeasons.Checked = sFilter.HideIgnoredSeasons;
            }
        }
Ejemplo n.º 9
0
    /// <summary>
    /// Draw the custom wizard.
    /// </summary>

    void OnGUI()
    {
        BetterList <UIDrawCall> dcs = UIDrawCall.activeList;

        dcs.Sort(delegate(UIDrawCall a, UIDrawCall b)
        {
            return(a.finalRenderQueue.CompareTo(b.finalRenderQueue));
        });

        if (dcs.size == 0)
        {
            EditorGUILayout.HelpBox("No NGUI draw calls present in the scene", MessageType.Info);
            return;
        }

        UIPanel selectedPanel = NGUITools.FindInParents <UIPanel>(Selection.activeGameObject);

        GUILayout.Space(12f);

        NGUIEditorTools.SetLabelWidth(100f);
        ShowFilter show = (NGUISettings.showAllDCs ? ShowFilter.AllPanels : ShowFilter.SelectedPanel);

        if ((ShowFilter)EditorGUILayout.EnumPopup("Draw Call Filter", show) != show)
        {
            NGUISettings.showAllDCs = !NGUISettings.showAllDCs;
        }

        GUILayout.Space(6f);

        if (selectedPanel == null && !NGUISettings.showAllDCs)
        {
            EditorGUILayout.HelpBox("No panel selected", MessageType.Info);
            return;
        }

        NGUIEditorTools.SetLabelWidth(80f);
        mScroll = GUILayout.BeginScrollView(mScroll);

        int dcCount = 0;

        for (int i = 0; i < dcs.size; ++i)
        {
            UIDrawCall dc        = dcs.buffer[i];
            string     key       = "Draw Call " + (i + 1);
            bool       highlight = (selectedPanel == null || selectedPanel == dc.manager);

            if (!highlight)
            {
                if (!NGUISettings.showAllDCs)
                {
                    continue;
                }

                if (UnityEditor.EditorPrefs.GetBool(key, true))
                {
                    GUI.color = new Color(0.85f, 0.85f, 0.85f);
                }
                else
                {
                    GUI.contentColor = new Color(0.85f, 0.85f, 0.85f);
                }
            }
            else
            {
                GUI.contentColor = Color.white;
            }

            ++dcCount;
            string name = key + " of " + dcs.size;
            if (!dc.isActive)
            {
                name = name + " (HIDDEN)";
            }
            else if (!highlight)
            {
                name = name + " (" + dc.manager.name + ")";
            }

            if (NGUIEditorTools.DrawHeader(name, key))
            {
                GUI.color = highlight ? Color.white : new Color(0.8f, 0.8f, 0.8f);

                NGUIEditorTools.BeginContents();
                EditorGUILayout.ObjectField("Material", dc.dynamicMaterial, typeof(Material), false);

                int count = 0;

                for (int a = 0; a < UIPanel.list.Count; ++a)
                {
                    UIPanel p = UIPanel.list[a];

                    for (int b = 0; b < p.widgets.Count; ++b)
                    {
                        UIWidget w = p.widgets[b];
                        if (w.drawCall == dc)
                        {
                            ++count;
                        }
                    }
                }

                string   myPath = NGUITools.GetHierarchy(dc.manager.cachedGameObject);
                string   remove = myPath + "\\";
                string[] list   = new string[count + 1];
                list[0] = count.ToString();
                count   = 0;

                for (int a = 0; a < UIPanel.list.Count; ++a)
                {
                    UIPanel p = UIPanel.list[a];

                    for (int b = 0; b < p.widgets.Count; ++b)
                    {
                        UIWidget w = p.widgets[b];

                        if (w.drawCall == dc)
                        {
                            string path = NGUITools.GetHierarchy(w.cachedGameObject);
                            list[++count] = count + ". " + (string.Equals(path, myPath) ? w.name : path.Replace(remove, ""));
                        }
                    }
                }

                GUILayout.BeginHorizontal();
                int sel = EditorGUILayout.Popup("Widgets", 0, list);
                NGUIEditorTools.DrawPadding();
                GUILayout.EndHorizontal();

                if (sel != 0)
                {
                    count = 0;

                    for (int a = 0; a < UIPanel.list.Count; ++a)
                    {
                        UIPanel p = UIPanel.list[a];

                        for (int b = 0; b < p.widgets.Count; ++b)
                        {
                            UIWidget w = p.widgets[b];

                            if (w.drawCall == dc && ++count == sel)
                            {
                                Selection.activeGameObject = w.gameObject;
                                break;
                            }
                        }
                    }
                }

                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Render Q", dc.finalRenderQueue.ToString(), GUILayout.Width(120f));
                bool draw = (Visibility)EditorGUILayout.EnumPopup(dc.isActive ? Visibility.Visible : Visibility.Hidden) == Visibility.Visible;
                NGUIEditorTools.DrawPadding();
                GUILayout.EndHorizontal();

                if (dc.isActive != draw)
                {
                    dc.isActive = draw;
                    NGUITools.SetDirty(dc.manager);
                }

                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Triangles", dc.triangles.ToString(), GUILayout.Width(120f));

                if (dc.manager != selectedPanel)
                {
                    if (GUILayout.Button("Select the Panel"))
                    {
                        Selection.activeGameObject = dc.manager.gameObject;
                    }
                    NGUIEditorTools.DrawPadding();
                }
                GUILayout.EndHorizontal();

                if (dc.manager.clipping != UIDrawCall.Clipping.None && !dc.isClipped)
                {
                    EditorGUILayout.HelpBox("You must switch this material's shader to Unlit/Transparent Colored or Unlit/Premultiplied Colored in order for clipping to work.",
                                            MessageType.Warning);
                }

                NGUIEditorTools.EndContents();
                GUI.color = Color.white;
            }
        }

        if (dcCount == 0)
        {
            EditorGUILayout.HelpBox("No draw calls found", MessageType.Info);
        }
        GUILayout.EndScrollView();
    }