当前位置: 首页>>代码示例>>C#>>正文


C# Properties.Contains方法代码示例

本文整理汇总了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);
             }
         }
     }
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:28,代码来源:RecentOpen.cs

示例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]));
			}
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:14,代码来源:RecentOpen.cs

示例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);
					}
				}
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:20,代码来源:RecentOpen.cs

示例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?());
			}
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:22,代码来源:CSharpFormattingOptionsContainer.cs

示例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"]);
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:16,代码来源:DefaultWorkbench.cs

示例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);
		}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:22,代码来源:CSharpFormattingOptionsContainer.cs

示例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"]);
     }
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:14,代码来源:DefaultWorkbench.cs


注:本文中的Properties.Contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。