本文整理汇总了C#中Util.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Util.ToString方法的具体用法?C# Util.ToString怎么用?C# Util.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util.ToString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateUserFavouriteLink
/// <summary>
/// Creates link which (depending on params) gets user favorites, adds a series to user
/// favorites or removes a series from the favorite lis
/// </summary>
/// <param name="_identifier"></param>
/// <param name="_type"></param>
/// <param name="_seriesId"></param>
/// <returns>Link</returns>
internal static String CreateUserFavouriteLink(String _identifier, Util.UserFavouriteAction _type, int _seriesId)
{
return TvdbLinks.BASE_SERVER + "/api/User_Favorites.php?accountid=" + _identifier
+ ((_type == Util.UserFavouriteAction.none) ? "" : ("&type=" + _type.ToString() + "&seriesid=" + _seriesId));
}
示例2: MakeUpdate
private bool MakeUpdate(Util.UpdateInterval _interval, bool _zipped)
{
Log.Info("Started update (" + _interval.ToString() + ")");
Stopwatch watch = new Stopwatch();
watch.Start();
DateTime startUpdate = DateTime.Now;
if (UpdateProgressed != null)
{//update has started, we're downloading the updated content from tvdb
UpdateProgressed(new UpdateProgressEventArgs(UpdateProgressEventArgs.UpdateStage.downloading,
"Downloading " + (_zipped ? " zipped " : " unzipped") + " updated content",
0, 0));
}
//update all flagged series
List<TvdbSeries> updateSeries;
List<TvdbEpisode> updateEpisodes;
List<TvdbBanner> updateBanners;
DateTime updateTime = m_downloader.DownloadUpdate(out updateSeries, out updateEpisodes, out updateBanners, _interval, _zipped);
List<int> cachedSeries = m_cacheProvider.GetCachedSeries();
//list of all series that have been loaded from cache
//and need to be saved to cache at the end of the update
Dictionary<int, TvdbSeries> seriesToSave = new Dictionary<int, TvdbSeries>();
if (UpdateProgressed != null)
{//update has started, we're downloading the updated content from tvdb
UpdateProgressed(new UpdateProgressEventArgs(UpdateProgressEventArgs.UpdateStage.seriesupdate,
"Begin updating series",
0, 25));
}
int countUpdatedSeries = updateSeries.Count;
int countSeriesDone = 0;
List<int> updatedSeriesIds = new List<int>();
List<int> updatedEpisodeIds = new List<int>();
List<int> updatedBannerIds = new List<int>();
foreach (TvdbSeries us in updateSeries)
{
//Update series that have been already cached
foreach (int s in cachedSeries)
{
if (us.Id == s)
{//changes occured in series
TvdbSeries series = m_cacheProvider.LoadSeriesFromCache(us.Id);
int currProg = (int)(100.0 / countUpdatedSeries * countSeriesDone);
if (UpdateSeries(series, us.LastUpdated, currProg))
{//the series has been updated
updatedSeriesIds.Add(us.Id);
//store the updated series to cache
//todo: better to save it immediately? the way it is now it consumes more
//memory because the series is kept in memory until the update finishes.
//the advantage is that if episodes of the series are updated as well, we
//don't have to load it again
if (!seriesToSave.ContainsKey(series.Id)) seriesToSave.Add(series.Id, series);
}
break;
}
}
countSeriesDone++;
}
int countEpisodeUpdates = updateEpisodes.Count; ;
int countEpisodesDone = 0;
//update all flagged episodes
foreach (TvdbEpisode ue in updateEpisodes)
{
foreach (int s in cachedSeries)
{
if (ue.SeriesId == s)
{//changes occured in series
TvdbSeries series = null;
if (seriesToSave.ContainsKey(s))
{
series = seriesToSave[s];
}
else
{
series = m_cacheProvider.LoadSeriesFromCache(ue.SeriesId);
}
int progress = (int)(100.0 / countEpisodeUpdates * countEpisodesDone);
if (UpdateEpisode(series, ue, progress))
{//The episode was updated or added
updatedEpisodeIds.Add(ue.Id);
if (!seriesToSave.ContainsKey(series.Id)) seriesToSave.Add(series.Id, series);
}
break;
}
}
countEpisodesDone++;
}
int countUpdatedBanner = updateBanners.Count;
int countBannerDone = 0;
// todo: update banner information here -> wait for forum response regarding
// missing banner id within updates (atm. I'm matching banners via path)
foreach (TvdbBanner b in updateBanners)
{
//.........这里部分代码省略.........
示例3: MakeUpdate
private bool MakeUpdate(Util.UpdateInterval _interval, bool _zipped)
{
Log.Info("Started update (" + _interval.ToString() + ")");
Stopwatch watch = new Stopwatch();
watch.Start();
//update all flagged series
List<TvdbSeries> updateSeries;
List<TvdbEpisode> updateEpisodes;
List<TvdbBanner> updateBanners;
DateTime updateTime = m_downloader.DownloadUpdate(out updateSeries, out updateEpisodes, out updateBanners, _interval, _zipped);
List<int> cachedSeries = m_cacheProvider.GetCachedSeries();
List<TvdbSeries> seriesToSave = new List<TvdbSeries>();
foreach (TvdbSeries us in updateSeries)
{
foreach (TvdbSeries s in m_loadedData.SeriesList)
{
if (us.Id == s.Id)
{
if (s.LastUpdated < us.LastUpdated)
{//changes occured in series
UpdateSeries(s, us.LastUpdated);
}
break;
}
}
//Update series that have been already cached but are not in memory
foreach (int s in cachedSeries)
{
if (us.Id == s)
{//changes occured in series
TvdbSeries series = m_cacheProvider.LoadSeriesFromCache(us.Id);
if (series.LastUpdated < us.LastUpdated)
{
UpdateSeries(series, us.LastUpdated);
AddSeriesToCache(series);
seriesToSave.Add(series);
}
break;
}
}
}
//update all flagged episodes
foreach (TvdbEpisode ue in updateEpisodes)
{
foreach (TvdbSeries s in m_loadedData.SeriesList)
{
if (ue.SeriesId == s.Id)
{
UpdateEpisode(s, ue);
break;
}
}
foreach (int s in cachedSeries)
{
if (ue.SeriesId == s)
{//changes occured in series
TvdbSeries series = m_cacheProvider.LoadSeriesFromCache(ue.SeriesId);
UpdateEpisode(series, ue);
break;
}
}
}
//todo: update banner information here -> wait for forum response regarding missing
foreach (TvdbBanner b in updateBanners)
{
foreach (TvdbSeries s in m_loadedData.SeriesList)
{
if (s.Id == b.SeriesId)
{
UpdateBanner(s, b);
break;
}
}
foreach (int s in cachedSeries)
{
if (b.SeriesId == s)
{//changes occured in series
TvdbSeries series = m_cacheProvider.LoadSeriesFromCache(s);
UpdateBanner(series, b);
break;
}
}
}
//set the last updated time to time of this update
m_loadedData.LastUpdated = updateTime;
watch.Stop();
Log.Info("Finished update (" + _interval.ToString() + ") in " + watch.ElapsedMilliseconds + " milliseconds");
return true;
}
示例4: mfnGrdSelect
/// <summary>
/// 그리드 검색
/// </summary>
/// <param name="p_Gubun">검색 구분값</param>
private void mfnGrdSelect(Util.GridSearch p_Gubun)
{
//if (txtSearchString.Text.Equals(""))
//{
// MessageBox.Show("검색어를 입력하여 주십시오.");
// return;
//}
SqlParameter[] param = new SqlParameter[3];
param[0] = new SqlParameter("@iWorkingTag", "LP");
param[1] = new SqlParameter("@iGubun", p_Gubun.ToString());
param[2] = new SqlParameter("@iSearchValue", txtSearchString.Text);
grdView.DataSource = Util.ConDB("sp_Study1", param);
}
示例5: DisplayBasePoint
private void DisplayBasePoint(Util.Variable.DataPoint point)
{
textBox3.Text = point.ToString() + " " + masterCurveManager.TransformFromPaneToScreen(point).ToString();
}
示例6: SetDataGridViewData
/// <summary>
/// Sets the data in DataGridView from the DataTable object.
/// The columns can be filtered or null to get all columns from the data table in the the data grid view.
/// </summary>
/// <param name="dataGridView"></param>
/// <param name="dataTable"></param>
/// <param name="columnFilter">The columns to filter.</param>
/// <param name="filterType">Whether to keep the items in the filter (remove all others) or remove them (keep all others).</param>
public static void SetDataGridViewData(DataGridView dataGridView, DataTable dataTable, IEnumerable<string> columnFilter, Util.FilterType filterType)
{
// Clear DGV if it's not data bound. If it is, it will be re-bound later, therefore cleaning the old data.
if (dataGridView.DataSource == null)
{
dataGridView.Rows.Clear();
dataGridView.Columns.Clear();
}
else
{
// Force data binding flush
dataGridView.DataSource = null;
}
// Bind the data
dataGridView.DataSource = dataTable;
// Hide the columns filtered out
if (columnFilter != null)
{
List<string> columnFilterList = new List<string>(columnFilter);
List<string> columns = Db.DbUtil.GetColumnNames(dataTable);
List<string> columnsToRemove = null;
// Get a list of columns to remove
if (filterType == Util.FilterType.Keep)
{
columnsToRemove = CollectionUtil<string>.Filter(columns, Util.FilterType.Remove, columnFilterList);
}
else if (filterType == Util.FilterType.Remove)
{
columnsToRemove = columnFilterList;
}
else
{
throw new Exception("Unkonwn filter type: " + filterType.ToString());
}
// Hide the columns
foreach (string col in columnsToRemove)
{
dataGridView.Columns[col].Visible = false;
}
// Force column order as defined in column filter
// but only if it's FilterType.Keep
if (filterType == Util.FilterType.Keep)
{
int i = 0;
foreach (string column in columnFilter)
{
dataGridView.Columns[column].DisplayIndex = i++;
}
}
}
dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
}