如下图所示,
var current = ProjectTree.SelectedItem.Tag, debug模式下可以看到 current 的value 是 {Siemens.Engineering.SW.Blocks.PlcBlockSystemGroup}, current的type 是 object {Siemens.Engineering.SW.Blocks.PlcBlockSystemGroup}
现在的问题是,这里的value 和 type指的什么意思。 用花括号代表着什么? 如果我想新造一个Siemens.Engineering.SW.Blocks.PlcBlockSystemGroup 的对象或者叫实例? 应该怎么弄?这个类长这样。 我这样写是报错的 PlcSystemBlockGroup current = new PlcSystemBlockGroup();
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security;
namespace Siemens.Engineering.SW.Blocks
{
//
// Summary:
// Group containing Plc system blocks & Plc system block groups
[DebuggerNonUserCode]
[SecuritySafeCritical]
public sealed class PlcSystemBlockGroup : IEngineeringObject, IEngineeringCompositionOrObject, IEngineeringInstance, IInternalObjectAccess, IInternalInstanceAccess, IInternalBaseAccess, IEquatable<object>
{
//
// Summary:
// Composition of Plc system blocks
public PlcBlockComposition Blocks { get; }
//
// Summary:
// Composition of Plc system block groups
public PlcSystemBlockGroupComposition Groups { get; }
//
// Summary:
// EOM parent of this object
public IEngineeringObject Parent { get; }
//
// Summary:
// The name of the Plc system block group
public string Name { get; }
//
// Summary:
// Determines whether the specified System.Object is equal to this instance.
//
// Parameters:
// obj:
// The System.Object to compare with this instance.
//
// Returns:
// true if the specified System.Object is equal to this instance; otherwise, false.
[SecuritySafeCritical]
public override bool Equals(object obj);
//
// Summary:
// Gets a list of attributes for the given names.
//
// Parameters:
// names:
// The names of the attributes to get.
//
// Returns:
// A list of the attributes for the given names with nulls for names not found.
[SecuritySafeCritical]
public IList<object> GetAttributes(IEnumerable<string> names);
//
// Summary:
// Returns a hash code for this instance.
//
// Returns:
// A hash code for this instance, suitable for use in hashing algorithms and data
// structures like a hash table.
[SecuritySafeCritical]
public override int GetHashCode();
//
// Summary:
// Sets a list of values for the given attributes.
//
// Parameters:
// attributes:
// The attributes value list.
[SecuritySafeCritical]
public void SetAttributes(IEnumerable<KeyValuePair<string, object>> attributes);
//
// Summary:
// Returns a System.String that represents the current System.Object.
//
// Returns:
// A System.String that represents the current System.Object.
[SecuritySafeCritical]
public override string ToString();
}
}