Beispiel #1
0
 public View(View view)
     : this()
 {
     //copy all members (deep copy)
     _name = view._name;
     _isEdited = view._isEdited;
     _showTypeCompleted = view._showTypeCompleted;
     _showTypeAdultContent = view._showTypeAdultContent;
     _showTypeMissingEpisodes = view._showTypeMissingEpisodes;
     _showTypeBluRay = view._showTypeBluRay;
     _showTypeDVD = view._showTypeDVD;
     _showTypeFavorite = view._showTypeFavorite;
     _showTypeNewEps = view._showTypeNewEps;
     _showTypeNewSeason = view._showTypeNewSeason;
     _showTypeRecentlyWatched = view._showTypeRecentlyWatched;
     _showTypeWatched = view._showTypeWatched;
     _showByDefault = view._showByDefault;
     _sortType = view._sortType;
     _labelStyleEps = view._labelStyleEps;
     _labelStyleGroups = view._labelStyleGroups;
     foreach (KeyValuePair<string, eShowType> y in view._dctGenre)
         _dctGenre.Add(y.Key, y.Value);
     foreach (KeyValuePair<string, eShowType> y in view._dctYear)
         _dctYear.Add(y.Key, y.Value);
     foreach (KeyValuePair<string, eShowType> y in view._dctAudioLang)
         _dctAudioLang.Add(y.Key, y.Value);
     foreach (KeyValuePair<string, eShowType> y in view._dctSubtitleLang)
         _dctSubtitleLang.Add(y.Key, y.Value);
     foreach (KeyValuePair<string, eShowType> y in view._dctAnimeType)
         _dctAnimeType.Add(y.Key, y.Value);
 }
Beispiel #2
0
            // ----------------------------------------------------------------------------------------
            // matrix_solver
            // ----------------------------------------------------------------------------------------
            protected matrix_solver_t(netlist_base_t anetlist, string name, eSortType sort, solver_parameters_t params_)
                : base(anetlist, name)
            {
                m_params              = params_;
                m_stat_calculations   = new state_var <int>(this, "m_stat_calculations", 0);
                m_stat_newton_raphson = new state_var <int>(this, "m_stat_newton_raphson", 0);
                m_stat_vsolver_calls  = new state_var <int>(this, "m_stat_vsolver_calls", 0);
                m_iterative_fail      = new state_var <int>(this, "m_iterative_fail", 0);
                m_iterative_total     = new state_var <int>(this, "m_iterative_total", 0);
                m_last_step           = new state_var <netlist_time>(this, "m_last_step", netlist_time.zero());
                m_fb_sync             = new logic_input_t(this, "FB_sync");
                m_Q_sync              = new logic_output_t(this, "Q_sync");
                m_ops  = 0;
                m_sort = sort;


                connect_post_start(m_fb_sync, m_Q_sync);
            }
Beispiel #3
0
            /// <summary>
            /// requests from server <see cref="CoinTickers"/> with indices in range
            /// [<paramref name="startIndex"/>, (<paramref name="startIndex"/> + <paramref name="numberOfCoins"/>)].
            /// </summary>
            /// <param name="startIndex"></param>
            /// <param name="numberOfCoins"></param>
            /// <param name="sortType"></param>
            /// <returns>
            /// <see cref="CoinTicker"/> array of length <paramref name="numberOfCoins"/> containing
            /// <see cref="CoinTicker"/>s of indices in range
            /// [[<paramref name="startIndex"/>, (<paramref name="startIndex"/> + <paramref name="numberOfCoins"/>)]
            /// </returns>
            /// <exception cref="CoinTickerRequestInvalidStartIndexException">
            /// thrown if <paramref name="startIndex"/> < 0
            /// </exception>
            /// <exception cref="CoinTickerRequestInvalidNumberOfCoinsException">
            /// thrown if <paramref name="numberOfCoins"/> <= 0 ||
            /// <paramref name="numberOfCoins"/> > COIN_TICKER_REQUEST_MAX_NUMBER_OF_COINS
            /// </exception>
            /// <exception cref="CoinTickerRequestInvalidStartIndexException">
            /// thrown if <paramref name="startIndex"/> does not exist in server.
            /// </exception>
            /// <exception cref="ServerResponseParseException">
            /// thrown if server response was invalid.
            /// </exception>
            public static CoinTicker[] RequestCoinTicker(
                int startIndex,
                int numberOfCoins,
                eSortType sortType = eSortType.Id)
            {
                if (startIndex < 0) // invalid start index
                {
                    throw new CoinTickerRequestInvalidStartIndexException(startIndex);
                }

                // invalid number of coins
                if (numberOfCoins <= 0 || numberOfCoins > COIN_TICKER_REQUEST_MAX_NUMBER_OF_COINS)
                {
                    throw new CoinTickerRequestInvalidNumberOfCoinsException(1, 100);
                }

                // prepare request
                string uri = TICKER_REQUEST_URL;

                GetRequestParameter[] requestParameters = new GetRequestParameter[]
                {
                    new GetRequestParameter("start", startIndex.ToString()),
                    new GetRequestParameter("limit", numberOfCoins.ToString()),
                    new GetRequestParameter("sort", sortTypeToString[sortType].ToString()),
                    new GetRequestParameter("structure", COIN_TICKER_REQUEST_STRUCTURE_TYPE)
                };

                string serverResponseJson = sendDataRequest(uri, requestParameters);

                try
                {
                    CoinTicker[] coinDataArray = CoinTicker.ParseArray(serverResponseJson, startIndex, numberOfCoins);

                    return(coinDataArray);
                }
                catch (CoinIndexNotFoundException coinIndexNotFoundException)
                {
                    throw new CoinTickerRequestInvalidStartIndexException(startIndex, coinIndexNotFoundException);
                }
                catch (CoinTickerJsonParseException coinTickerJsonParseException)
                {
                    throw new ServerResponseParseException(coinTickerJsonParseException);
                }
            }
        public static FriendListSorter CreateSorter(eSortType i_SortType)
        {
            FriendListSorter result = null;

            switch (i_SortType)
            {
            case eSortType.SortByFirstName:
            {
                result = new SorterByFirstName();
            }

            break;

            case eSortType.SortByLastName:
            {
                result = new SorterByLastName();
            }

            break;
            }

            return(result);
        }
Beispiel #5
0
        private void LoadFolderData(bool forceRebuild)
        {
            try
            {
                if (forceRebuild)
                {
                    listViewItems.Columns.Clear();

                    foreach (MMRSettings.MetadataSet.MetaGridColumn col in currentSettings.MetadataSettings.MetaGridColumns)
                    {
                        if (colsRightJustified.Contains(col.Name, System.StringComparer.CurrentCultureIgnoreCase))
                        {
                            listViewItems.Columns.Add(col.Name, col.Width, HorizontalAlignment.Right);
                        }
                        else
                        {
                            listViewItems.Columns.Add(col.Name, col.Width, HorizontalAlignment.Left);
                        }
                    }
                }

                DirectoryInfo dir = new DirectoryInfo(this.explorerTree1.SelectedPath);

                this.listViewItems.Items.Clear();

                Metadata.BaseHeader head = null;
                if (dir.Exists)
                {
                    foreach (FileInfo fil in dir.GetFiles())
                    {
                        if (MetadataExtensionSupported(GetFileExtension(fil.Name).ToUpper()))
                        {
                            ListViewItem lvi = new ListViewItem();
                            lvi.Tag = fil;
                            head    = null;

                            string colName = String.Empty;
                            string content = String.Empty;

                            try
                            {
                                Metadata.MobiMetadata mobiMeta = new Metadata.MobiMetadata(fil.FullName);

                                foreach (ColumnHeader col in this.listViewItems.Columns)
                                {
                                    colName = col.Text.Substring(2, col.Text.Length - 2);
                                    head    = null;
                                    switch (col.Text.Substring(0, 1))
                                    {
                                    case "P": head = mobiMeta.PDBHeader; break;

                                    case "D": head = mobiMeta.PalmDocHeader; break;

                                    case "M": head = mobiMeta.MobiHeader; break;

                                    case "E": head = mobiMeta.MobiHeader.EXTHHeader; break;

                                    case "S":
                                        switch (colName.ToUpper())
                                        {
                                        case "FILENAME":
                                            content = fil.Name;
                                            break;

                                        case "SIZE (KB)":
                                            content = (fil.Length / 1000).ToString();
                                            break;

                                        case "CREATED":
                                            content = fil.CreationTime.ToString("dd MMM yyyy hh:mm:ss");
                                            break;
                                        }
                                        break;
                                    }

                                    if (head != null)
                                    {
                                        content = head.FieldList[col.Text.Substring(2, col.Text.Length - 2)].ToString();
                                    }

                                    if (lvi.Text == String.Empty)
                                    {
                                        lvi.Text = content;
                                    }
                                    else
                                    {
                                        lvi.SubItems.Add(content);
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                lvi.SubItems.Add(ex.Message);
                            }

                            this.listViewItems.Items.Add(lvi);
                        }
                    }

                    int maxColWidth = currentSettings.MetadataSettings.MaxColWidth;

                    //Only auto-resize if the column is less than max width

                    if (currentSettings.MetadataSettings.AutoSizeColumns)
                    {
                        for (int i = 0; i < listViewItems.Columns.Count; i++)
                        {
                            listViewItems.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
                            if (listViewItems.Columns[i].Width > maxColWidth)
                            {
                                listViewItems.Columns[i].Width = maxColWidth;
                            }
                        }
                    }

                    //Sort the data
                    foreach (ColumnHeader col in listViewItems.Columns)
                    {
                        if (col.Text == currentSettings.MetadataSettings.OrderBy.Name)
                        {
                            eSortType sortType = eSortType.String;
                            if (colsOrderByDate.Contains(col.Text, System.StringComparer.CurrentCultureIgnoreCase))
                            {
                                sortType = eSortType.DateTime;
                            }
                            else if (colsOrderByNumber.Contains(col.Text, System.StringComparer.CurrentCultureIgnoreCase))
                            {
                                sortType = eSortType.Number;
                            }
                            listViewItems.ListViewItemSorter = new ListViewCustomSort(col.Index, currentSettings.MetadataSettings.OrderBy.Ascending, sortType);
                            listViewItems.Sort();
                        }
                    }
                }

                if (this.listViewItems.Items.Count > 0)
                {
                    this.listViewItems.Items[0].Selected = true;
                }
            }

            catch (Exception ex)
            {
                currentSettings.MetadataSettings.MetaFolder = currentSettings.FilePath;
                throw ex;
            }
        }
Beispiel #6
0
 public ListViewCustomSort(int sortColumn, bool ascending, eSortType sortType)
 {
     SortColumn = sortColumn;
     Ascending  = ascending;
     SortType   = sortType;
 }
 public SortExpression(string name, eSortType st)
 {
     SortName = name;
     SortType = st;
 }
 public SortExpression(string name)
 {
     SortName = name;
     SortType = eSortType.Asc;
 }
Beispiel #9
0
        internal static void addColumnFieldToPivot(ExcelPivotTable pivot, string fieldName, eSortType sort)
        {
            ExcelPivotTableField fieldC = pivot.ColumnFields.Add(pivot.Fields[fieldName]);

            fieldC.Compact           = false;
            fieldC.Outline           = false;
            fieldC.SubTotalFunctions = eSubTotalFunctions.None;
            fieldC.Sort = sort;
        }
Beispiel #10
0
        internal static void addFilterFieldToPivot(ExcelPivotTable pivot, string fieldName, eSortType sort, bool isMultiSelect)
        {
            ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields[fieldName]);

            fieldF.Sort = sort;
            fieldF.MultipleItemSelectionAllowed = isMultiSelect;
        }
Beispiel #11
0
        internal static void addFilterFieldToPivot(ExcelPivotTable pivot, string fieldName, eSortType sort)
        {
            ExcelPivotTableField fieldF = pivot.PageFields.Add(pivot.Fields[fieldName]);

            fieldF.Sort = sort;
        }
Beispiel #12
0
 protected matrix_solver_direct_t(UInt32 SIZE, netlist_base_t anetlist, string name, eSortType sort, solver_parameters_t params_, UInt32 size)
     : base(null, null, eSortType.NOSORT, params_)
 {
     throw new emu_unimplemented();
 }