当折叠方法等的 XML 注释时。过去是隐藏摘要。正如我希望的那样。然后在 VS2015 中他们打破了这一点。我问了一个关于 VS2015 的类似问题,并在这里得到了一个很好的解决方法- 使用<para>.
直到现在,该解决方法在 VS2017 中仍然有效。现在我更新到版本 15.5.1 并且解决方法被破坏了,(为什么??...)并且我找不到改变它的设置。
某处有吗?
根据此答案 ,似乎没有为 Windows 服务设置版本的官方方法。但是,这可以通过将其插入其Descriptionor来完成DisplayName。
我希望能够更改该版本号而无需删除和重新安装该服务。但是除了安装本身之外,我找不到设置说明的方法。
那么,有没有一种方法,它是什么,可以在不重新安装服务的情况下更改服务的描述?
最好使用.Net。如果重要的话,服务本身也是 .Net。
这是我曾经有效的代码:
MSBuildWorkspace msBuild = MSBuildWorkspace.Create();
Solution sln = await msBuild.OpenSolutionAsync(solutionPath);
Run Code Online (Sandbox Code Playgroud)
但现在我得到:
int pr = sln.Projects.Count();//is 1 instead of 2.
Run Code Online (Sandbox Code Playgroud)
和:
int docs = sln.Projects.First().Documents.Count();//is 0
Run Code Online (Sandbox Code Playgroud)
他们又改了吗?
(如果重要的话,我需要Solution迭代字段等并使用Renamer.RenameSymbolAsync。)
我不知道该如何开始.谷歌搜索后,我在这里找到了这个:
//This is how you do it (kudos to sipwiz)
UdpClient udpServer = new UdpClient(localpt);
//This is what the proprietary (see question) sender would do (nothing special)
//!!! The following 3 lines is what the poster needs...
//(and the definition of localpt, of course)
UdpClient udpServer2 = new UdpClient();
udpServer2.Client.SetSocketOption(
SocketOptionLevel.Socket,
SocketOptionName.ReuseAddress, true);
udpServer2.Client.Bind(localpt);
Run Code Online (Sandbox Code Playgroud)
但我不知道我还需要什么.我从这里尝试了一个示例,但收到一条错误消息:"现有连接被远程主机强行关闭."
我该怎么办?
在阅读了Control.Clear();导致内存泄漏(在MSDN上验证)之后,我想知道是否:
while (Controls.Count > 0) Controls[0].Dispose();
Run Code Online (Sandbox Code Playgroud)
就足够了,还是我必须递归遍历控件中的所有控件?
此外,有没有理由Control.Clear();在那之后做一个?(因为我看到有人说某处)?
谢谢.
是否有理由使用此:
bool flag;
public Form1()
{
if (flag) byDelegate = square;
else byDelegate = cube;
Text = byDelegate(3).ToString();
}
int square(int i) { return i * i; }
int cube(int i) { return i * i * i; }
delegate int delegate1(int x);
delegate1 byDelegate;
Run Code Online (Sandbox Code Playgroud)
而不是:
bool flag;
public Form2()
{
Text = fakeDelegate(3).ToString();
}
int square(int i) { return i * i; }
int cube(int i) { return i * i * i; }
int fakeDelegate(int i)
{
if …Run Code Online (Sandbox Code Playgroud) 我有一个ObservableCollection我正在改变使用string[] s = myObservableCollection.ToArray();这个工作正常.但是,我注意到VS在自动完成时没有提供.它只提供ToArray<>.所以我想知道 - 这是否意味着它在所有情况或平台等都不受支持?
我正在使用FileUtilities.CopyFileCopyFileEx 的包装器http://msdn.microsoft.com/en-us/magazine/cc163851.aspx.我认为CopyFileCallbackAction直到复制文件之后才会调用(我已经尝试复制一个大文件).因此问这个如何让CopyFileEx报告回来这样我可以取消文件复制操作?题.但现在我发现它实际上被多次调用,但由于某种原因它混淆了我试图显示进度的形式 - 在复制完成之前表单不会更新.事实上,如果我尝试在Shown事件处理程序中运行它- 表单有空白框,按钮应该是 - 直到复制完成.这是为什么?
我试图模仿这个答案但是虽然这有效:
public class TrackBarMenuItem : ToolStripControlHost
{
TrackBar trackBar;
public TrackBarMenuItem()
: base(new TrackBar())
{
trackBar = Control as TrackBar;
}
}
Run Code Online (Sandbox Code Playgroud)
这不是:
public class PanelMenuItem : ToolStripControlHost
{
Panel panel;
public PanelMenuItem()
: base(new Panel())
{
panel = Control as Panel;
Visible = true;
Enabled = true;
panel.AutoSize = false;
panel.Size = new Size(100, 50);
}
}
Run Code Online (Sandbox Code Playgroud)
为什么?
我这样叫他们:
contextMenuStrip1.Items.Add(new TrackBarMenuItem());
contextMenuStrip1.Items.Add(new PanelMenuItem());
Run Code Online (Sandbox Code Playgroud) “直接”是指类似于 Size*2(不起作用)的东西,而不是:
size1 = new Size(size1.Width * 2, size1.Height * 2);
Run Code Online (Sandbox Code Playgroud) c# ×10
winforms ×3
.net ×2
delegates ×1
file-copying ×1
intellisense ×1
memory-leaks ×1
roslyn ×1
udp ×1
xml-comments ×1