goo blog サービス終了のお知らせ 

日々のDraft

回答原案集

教えてgoo Q3320160(Generic Collection (Of 構造体)への代入)

2007-09-06 10:41:52 | メモ(個人的に忘れないように)
嵌った。By Designだとぉ!?

Compiler error when assigning a value to structure's member accessed via dictionary
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=295107

http://oshiete1.goo.ne.jp/qa3320160.html

一応配列で対処できることは確認できたけれども

>何がエラーの原因かは理解されていますよね?
いや、すまん、実は英文読んでもいまいちぴんと来てない(汗)
・・・とは言えず。

VB.NETで書いてはいるが,できるだけVB独自の変な仕組みに頼りたくないので
配列を使うなら
http://oshiete1.goo.ne.jp/qa3277715.html

あたりも考慮に入れて作らないといけないなる。

Class SampleA
Private SampleAPoint As System.Drawing.Point

Sub New(x As Integer,y As Integer)

With SampleAPoint
.X = x
.Y = y
End With

End Sub

Public Property Point As System.Drawing.Point
Get
Return SampleAPoint
End Get
Set(value As System.Drawing.Point)

SampleAPoint = value

End Set
End Property




End Class


Class SampleB

Private SampleBInt As Integer

Sub New(x As Integer)

SampleBInt = x

End Sub

Public Property intValue As Integer

Get
Return SampleBInt
End Get
Set(value As Integer)

SampleBInt = value

End Set

End Property




End Class

Class SampleC

Private SampleAPoints As New System.Collections.Generic.List(Of SampleA)

Public ReadOnly Property Points As System.Collections.Generic.List(Of SampleA)
Get
Return SampleAPoints
End Get
End Property


End Class


Class SampleD

Private SampleBInts As New System.Collections.Generic.List(Of SampleB)

Public ReadOnly Property Ints As System.Collections.Generic.List(Of SampleB)
Get
Return SampleBInts
End Get
End Property


End Class
Class himajin100000

Shared Sub Main

' Dim hoge As New SampleA(50,50)
' Dim Samp As New SampleC
'
' Samp.Points.Add(hoge)
' Samp.Points(0).Point.X = 40 'エラー

Dim hoge2 As New SampleB(8)
Dim Samp2 As New SampleD

Samp2.Ints.Add(hoge2)

Samp2.Ints(0).intValue = 5

'構造体もプリミティブ型も「値型変数」
'コレクションのitemは共に「参照型」で「代入後に実体がある」クラス。

Dim hoge3 As hogefuga
hoge3.funya.X = 5
'構造体のネストは問題なし

End Sub

End Class

Structure hogefuga

Dim funya As System.Drawing.Point



End Structure

>でも、構造体自体をメンバにて公開にしたら同じことですよね。
何故同じなのか,何が同じなのかさっぱりわからない


教えてgoo Q3218722(Need XLink Tutorial)

2007-08-11 03:30:35 | メモ(個人的に忘れないように)
http://oshiete1.goo.ne.jp/qa3218722.html

こっちです。
http://www.w3.org/TR/xlink/
http://en.wikipedia.org/wiki/XLink

>Uses of XLink
>Mozilla Firefox
>Netscape

http://www.w3.org/XML/Linking

>Mozilla: The Opensource browser has support for XLinks simple links.

へぇ・・・後でBugzillaで検索してみよう。

Drop XLink support
https://bugzilla.mozilla.org/show_bug.cgi?id=332773

うーん・・・
できればextended linkなものを見られると面白そうなのだけれど・・・・

注)こっちではありません
http://www.teamxlink.co.uk/
http://en.wikipedia.org/wiki/XLink_Kai