小编Ama*_*mal的帖子

用于cref时的"T:"是什么?

T:部分在使用cref属性时意味着什么?

<see cref="T:System.Windows.Form.Control"/>
Run Code Online (Sandbox Code Playgroud)

<see cref="System.Windows.Form.Control"/>
Run Code Online (Sandbox Code Playgroud)

c# xml-comments

6
推荐指数
1
解决办法
570
查看次数

如何处置XmlDocument

我正在使用流创建 XmlDocument,并在 XmlDocument 中进行一些更改,并将 XmlDocument 保存到流本身。

XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(fileStream);

////
////

////  
xmlDocument.Save(fileStream);
//how to dispose the created XmlDocument object.
Run Code Online (Sandbox Code Playgroud)

现在我如何销毁 XmlDocument 对象?

.net c# xmldocument

5
推荐指数
3
解决办法
1万
查看次数

为什么不直接暴露画笔而不是控件的Color属性?

一般情况下,Control的背景颜色设置将在OnPaint()中绘制,并使用如下所示的控件背景颜色创建画笔,

using (SolidBrush brush = new SolidBrush(this.BackColor))
{
   e.Graphics.FillRectangle(brush, e.ClipRectangle);
}
Run Code Online (Sandbox Code Playgroud)

我的问题是,为什么颜色暴露在外面以及为什么刷子是在内部创建的.

而不是像Color BackColor,Color ForeColor那样暴露颜色属性.为什么我们不能直接将画笔暴露给控件,如Brush BackgroundBrush,Brush ForegroundBrush?

问候,

c# controls winforms

2
推荐指数
1
解决办法
120
查看次数

如何在C#中将List <Class>转换为Dictionary <string,List <String >>?

在此输入图像描述Class用的性质StringList<String>.我想将其转换List<Class>为a Dictionary<String, List<String>>,但我无法做到这一点.如何List<Class>直接转换为Dictionary?

public class SerializationClass
{
    string key;
    List<string> values;

    public SerializationClass()
    {

    }
    public string Key
    {
        get
        {
            return this.key;
        }
        set
        {
            this.key = value;
        }
    }

    public List<string> Values
    {
        get
        {
            return this.values;
        }
        set
        {
            this.values = value;
        }
    }

    public SerializationClass(string _key, List<string> _values)
    {
        this.Key = _key;
        this.Values = _values;
    }
}
Run Code Online (Sandbox Code Playgroud)

列表的人口是,

List<SerializationClass> tempCollection = new List<SerializationClass>();
Run Code Online (Sandbox Code Playgroud)

在这里,我想转换为转换 …

c# windows string dictionary list

0
推荐指数
1
解决办法
1002
查看次数

标签 统计

c# ×4

.net ×1

controls ×1

dictionary ×1

list ×1

string ×1

windows ×1

winforms ×1

xml-comments ×1

xmldocument ×1