Я написал это на днях
#! /usr/bin/env python
class node:
def __init__(self):
self.data = None # contains the data
self.next = None # contains the reference to the next node
class linked_list:
def __init__(self):
self.cur_node = None
def add_node(self, data):
new_node = node() # create a new node
new_node.data = data
new_node.next = self.cur_node # link the new node to the 'previous' node.
self.cur_node = new_node # set the current node to the new one.
def list_print(self):
node = self.cur_node # cant point to ll!
while node:
print node.data
node = node.next
ll = linked_list()
ll.add_node(1)
ll.add_node(2)
ll.add_node(3)
ll.list_print()
При использовании этого в Отражательном C# можно добраться, гуид от свойства приписывают следующим образом
var propertyAttributes= property.GetCustomAttributes();
foreach(var attribute in propertyAttributes)
{
var myguid= Guid.Parse(attribute.Id.ToString());
}
Guid.NewGuid ()
создает новый случайный идентификатор.
Есть два способа
var guid = Guid.NewGuid();
или
var guid = Guid.NewGuid().ToString();
оба используют класс Guid, первый создает объект Guid, второй - строку Guid.
var guid = new Guid();
Эй, это а ' действительно ', хотя и не очень полезно, Guid.
(Guid - это все нули, если вы не знаете. Иногда это необходимо, чтобы указать отсутствие guid, в случаях, когда вы не хотите использовать Guid, допускающий значение NULL)