本文整理汇总了C#中SerializableDictionary.TryGetValue方法的典型用法代码示例。如果您正苦于以下问题:C# SerializableDictionary.TryGetValue方法的具体用法?C# SerializableDictionary.TryGetValue怎么用?C# SerializableDictionary.TryGetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializableDictionary
的用法示例。
在下文中一共展示了SerializableDictionary.TryGetValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawScheduleIcon
private bool DrawScheduleIcon(GuideProgramCell cell, PaintEventArgs e, float titleTop, ref int titleLeft, SerializableDictionary<Guid, GuideUpcomingProgram> upcomingById)
{
GuideUpcomingProgram upcomingProgramInfo;
if (upcomingById.TryGetValue(cell.GetUniqueUpcomingProgramId(), out upcomingProgramInfo))
{
Icon icon;
string toolTip = null;
if (upcomingProgramInfo.UpcomingRecording != null)
{
toolTip = ProcessUtility.BuildRecordingInfoToolTip(upcomingProgramInfo.UpcomingRecording, "on");
}
string toolTip2;
ProgramIconUtility.GetIconAndToolTip(upcomingProgramInfo.Type, upcomingProgramInfo.CancellationReason,
upcomingProgramInfo.IsPartOfSeries, _model.UpcomingRecordings, upcomingProgramInfo.UpcomingRecording,
out icon, out toolTip2);
if (!String.IsNullOrEmpty(toolTip2))
{
if (!String.IsNullOrEmpty(toolTip))
{
toolTip = toolTip + Environment.NewLine + Environment.NewLine + toolTip2;
}
else
{
toolTip = toolTip2;
}
}
Rectangle iconRectangle = new Rectangle(titleLeft, (int)Math.Round(titleTop), icon.Width, icon.Height);
if (!String.IsNullOrEmpty(toolTip))
{
cell.ToolTips.Add(new CellToolTip(iconRectangle, toolTip));
}
int height = (int)(icon.Height * _heightFactor);
e.Graphics.DrawIcon(icon, iconRectangle.X, iconRectangle.Y + (int)Math.Floor((height - icon.Height) / 2.0));
titleLeft += icon.Width;
return true;
}
return false;
}
示例2: ShowCustomSettingsForm
public bool ShowCustomSettingsForm(ref SerializableDictionary<string, string> settings)
{
IQFeedSettings dlg = new IQFeedSettings();
string ignorelast = "";
if (settings.TryGetValue("IgnoreLastHistBar", out ignorelast))
{
dlg.IgnoreLastHistBar = Convert.ToBoolean(ignorelast);
}
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
settings["IgnoreLastHistBar"] = dlg.IgnoreLastHistBar.ToString();
}
return true;
}
示例3: Initialize
public bool Initialize(SerializableDictionary<string, string> settings)
{
string rth = "";
string ignorelast;
string clientIDBroker = "";
string clientIDLiveData = "";
string clientIDHist = "";
if (settings.TryGetValue("UseRTH", out rth))
{
_useRTH = Convert.ToBoolean(rth);
}
if (settings.TryGetValue("IgnoreLastHistBar", out ignorelast))
{
dropLastHistBar = Convert.ToBoolean(ignorelast);
}
if (settings.TryGetValue("ClientIDBroker", out clientIDBroker))
{
int.TryParse(clientIDBroker, out _clientIDBroker);
}
if (settings.TryGetValue("ClientIDLiveData", out clientIDLiveData))
{
int.TryParse(clientIDLiveData, out _clientIDLiveData);
}
if (settings.TryGetValue("ClientIDHist", out clientIDHist))
{
int.TryParse(clientIDHist, out _clientIDHist);
}
settings.TryGetValue("AccountCode", out accountCode);
string faMethod;
if (settings.TryGetValue("FAMethod", out faMethod))
{
_FAMethod = GetFAMethod(faMethod);
}
settings.TryGetValue("FAPercentage", out _FAPercentage);
settings.TryGetValue("FAProfile", out _FAProfile);
return true;
}
示例4: Initialize
public bool Initialize(SerializableDictionary<string, string> settings)
{
string ignorelast;
if (settings.TryGetValue("IgnoreLastHistBar", out ignorelast))
{
dropLastHistBar = Convert.ToBoolean(ignorelast);
}
return true;
}
示例5: ShowCustomSettingsForm
public bool ShowCustomSettingsForm(ref SerializableDictionary<string, string> settings)
{
TWSSettings dlg = new TWSSettings();
string rth = "";
string ignorelast = "";
string clientIDBroker = _clientIDBroker.ToString();
string clientIDLiveData = _clientIDLiveData.ToString();
string clientIDHist = _clientIDHist.ToString();
string acctCode = "";
string faMethod = "";
string faPercentage = "";
string faProfile = "";
if (settings.TryGetValue("UseRTH", out rth))
{
dlg.UseRTH = Convert.ToBoolean(rth);
}
if (settings.TryGetValue("IgnoreLastHistBar", out ignorelast))
{
dlg.IgnoreLastHistBar = Convert.ToBoolean(ignorelast);
}
if (settings.TryGetValue("ClientIDBroker", out clientIDBroker))
{
dlg.ClientIDBroker = clientIDBroker;
}
else
{
dlg.ClientIDBroker = _clientIDBroker.ToString();
}
if (settings.TryGetValue("ClientIDLiveData", out clientIDLiveData))
{
dlg.ClientIDLiveData = clientIDLiveData;
}
else
{
dlg.ClientIDLiveData = _clientIDLiveData.ToString();
}
if (settings.TryGetValue("ClientIDHist", out clientIDHist))
{
dlg.ClientIDHist = clientIDHist;
}
else
{
dlg.ClientIDHist = _clientIDHist.ToString();
}
if (settings.TryGetValue("AccountCode", out acctCode))
{
dlg.AccountCode = acctCode;
}
if (settings.TryGetValue("FAMethod", out faMethod))
{
dlg.FAMethod = GetFAMethod(faMethod); ;
}
if (settings.TryGetValue("FAPercentage", out faPercentage))
{
dlg.FAPercentage = faPercentage;
}
if (settings.TryGetValue("FAProfile", out faProfile))
{
dlg.FAProfile = faProfile;
}
if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
settings["UseRTH"] = dlg.UseRTH.ToString();
settings["IgnoreLastHistBar"] = dlg.IgnoreLastHistBar.ToString();
settings["ClientIDBroker"] = dlg.ClientIDBroker;
settings["ClientIDLiveData"] = dlg.ClientIDLiveData;
settings["ClientIDHist"] = dlg.ClientIDHist;
settings["AccountCode"] = dlg.AccountCode;
settings["FAMethod"] = dlg.FAMethod.ToString();
settings["FAPercentage"] = dlg.FAPercentage;
settings["FAProfile"] = dlg.FAProfile;
}
return true;
}