本文整理汇总了C#中Properties.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# Properties.Contains方法的具体用法?C# Properties.Contains怎么用?C# Properties.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Properties
的用法示例。
在下文中一共展示了Properties.Contains方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RecentOpen
public RecentOpen(Properties p)
{
this.MAX_LENGTH = 10;
this.lastfile = new List<string>();
this.lastproject = new List<string>();
if (p.Contains("Files"))
{
string[] strArray = p["Files"].Split(new char[] { ',' });
foreach (string str in strArray)
{
if (File.Exists(str))
{
this.lastfile.Add(str);
}
}
}
if (p.Contains("Projects"))
{
string[] strArray2 = p["Projects"].Split(new char[] { ',' });
foreach (string str in strArray2)
{
if (File.Exists(str))
{
this.lastproject.Add(str);
}
}
}
}
示例2: RecentOpen
public RecentOpen(Properties p)
{
// don't check whether files exist because that might be slow (e.g. if file is on network
// drive that's unavailable)
// if one of these entries is a string, then it's from a previous SharpDevelop version - don't try loading it
if (p.Contains("Files") && !(p.Get("Files") is string)) {
lastfile.AddRange(p.Get("Files", new string[0]));
}
if (p.Contains("Projects") && !(p.Get("Files") is string)) {
lastproject.AddRange(p.Get("Projects", new string[0]));
}
}
示例3: RecentOpen
public RecentOpen(Properties p)
{
if (p.Contains("Files")) {
string[] files = p["Files"].Split(',');
foreach (string file in files) {
if (File.Exists(file)) {
lastfile.Add(file);
}
}
}
if (p.Contains("Projects")) {
string[] projects = p["Projects"].Split(',');
foreach (string file in projects) {
if (File.Exists(file)) {
lastproject.Add(file);
}
}
}
}
示例4: Load
public void Load(Properties parentProperties)
{
if (parentProperties == null)
throw new ArgumentNullException("parentProperties");
if (parentProperties.Contains("CSharpFormatting")) {
Properties formatProperties = parentProperties.NestedProperties("CSharpFormatting");
if (formatProperties != null) {
foreach (var key in formatProperties.Keys) {
try {
object val = formatProperties.Get(key, (object)null);
SetOption(key, val);
} catch (Exception) {
// Silently ignore loading error, then this property will be "as parent" automatically
}
}
}
indentationSize = formatProperties.Get(IndentationSizePropertyName, new int?());
convertTabsToSpaces = formatProperties.Get(ConvertTabsToSpacesPropertyName, new bool?());
}
}
示例5: SetMemento
public void SetMemento(Properties properties)
{
if (properties != null && properties.Contains("bounds")) {
string[] bounds = properties["bounds"].Split(',');
if (bounds.Length == 4) {
Bounds = normalBounds = new Rectangle(int.Parse(bounds[0], NumberFormatInfo.InvariantInfo),
int.Parse(bounds[1], NumberFormatInfo.InvariantInfo),
int.Parse(bounds[2], NumberFormatInfo.InvariantInfo),
int.Parse(bounds[3], NumberFormatInfo.InvariantInfo));
}
defaultWindowState = (FormWindowState)Enum.Parse(typeof(FormWindowState), properties["defaultstate"]);
FullScreen = properties.Get("fullscreen", false);
WindowState = (FormWindowState)Enum.Parse(typeof(FormWindowState), properties["windowstate"]);
}
}
示例6: Save
public void Save(Properties parentProperties)
{
if (parentProperties == null)
throw new ArgumentNullException("parentProperties");
// Create properties container from container settings
Properties formatProperties = new Properties();
foreach (var activeOption in activeOptions) {
object val = GetOption(activeOption);
if (val != null) {
formatProperties.Set(activeOption, val);
}
}
if (formatProperties.Contains(AutoFormattingOptionName) && !autoFormatting.HasValue) {
// AutoFormatting options was activated previously, remove it now
formatProperties.Remove(AutoFormattingOptionName);
} else {
formatProperties.Set(AutoFormattingOptionName, autoFormatting);
}
parentProperties.SetNestedProperties("CSharpFormatting", formatProperties);
}
示例7: SetMemento
public void SetMemento(Properties properties)
{
if ((properties != null) && properties.Contains("bounds"))
{
string[] strArray = properties["bounds"].Split(new char[] { ',' });
if (strArray.Length == 4)
{
base.Bounds = this.normalBounds = new Rectangle(int.Parse(strArray[0], NumberFormatInfo.InvariantInfo), int.Parse(strArray[1], NumberFormatInfo.InvariantInfo), int.Parse(strArray[2], NumberFormatInfo.InvariantInfo), int.Parse(strArray[3], NumberFormatInfo.InvariantInfo));
}
this.defaultWindowState = (FormWindowState) Enum.Parse(typeof(FormWindowState), properties["defaultstate"]);
this.FullScreen = properties.Get<bool>("fullscreen", false);
base.WindowState = (FormWindowState) Enum.Parse(typeof(FormWindowState), properties["windowstate"]);
}
}