コード例 #1
0
 void SetDataItemProperty(DataItem dataItem, NodeProperty property)
 {
     if (property.Anchor != null)
     {
         currentDocument.AnchoredItems[property.Anchor] = dataItem;
     }
     dataItem.Property = property;
 }
コード例 #2
0
ファイル: YamlParser.cs プロジェクト: fakedarren/Packager.NET
		private NodeProperty ParseNodeProperty(out bool success)
		{
			NodeProperty nodeProperty = new NodeProperty();

			while (true)
			{
				int seq_start_position1 = position;
				nodeProperty.Tag = ParseTag(out success);
				if (!success)
				{
					Error("Failed to parse Tag of NodeProperty.");
					break;
				}

				while (true)
				{
					int seq_start_position2 = position;
					ParseSeparationLines(out success);
					if (!success)
					{
						Error("Failed to parse SeparationLines of NodeProperty.");
						break;
					}

					nodeProperty.Anchor = ParseAnchor(out success);
					if (!success)
					{
						Error("Failed to parse Anchor of NodeProperty.");
						position = seq_start_position2;
					}
					break;
				}
				success = true;
				break;
			}
			if (success) { ClearError(); return nodeProperty; }

			while (true)
			{
				int seq_start_position3 = position;
				nodeProperty.Anchor = ParseAnchor(out success);
				if (!success)
				{
					Error("Failed to parse Anchor of NodeProperty.");
					break;
				}

				while (true)
				{
					int seq_start_position4 = position;
					ParseSeparationLines(out success);
					if (!success)
					{
						Error("Failed to parse SeparationLines of NodeProperty.");
						break;
					}

					nodeProperty.Tag = ParseTag(out success);
					if (!success)
					{
						Error("Failed to parse Tag of NodeProperty.");
						position = seq_start_position4;
					}
					break;
				}
				success = true;
				break;
			}
			if (success) { ClearError(); return nodeProperty; }

			return nodeProperty;
		}