What is the best way in c# to determine whether the programmer is running the program via IDE or it's user?

c#中确定程序员是通过IDE或其用户运行程序的最佳方式是什么? if (System.Diagnostics.Debugger.IsAttached) { // You are debugging } public static bool IsInVisualStudio { get { bool inIDE = false; string[] args = System.Environment.GetCommandLineArgs(); if (args != null && args.Length > 0) { string prgName = args[0].ToUpper();

在c#中确定程序员是通过IDE还是用户运行程序的最佳方式是什么?

c#中确定程序员是通过IDE或其用户运行程序的最佳方式是什么? if (System.Diagnostics.Debugger.IsAttached) { // You are debugging } public static bool IsInVisualStudio { get { bool inIDE = false; string[] args = System.Environment.GetCommandLineArgs(); if (args != null && args.Length > 0) { string prgName = args[0].ToUpper();

How to make LINQ

I have implemented a basic (naive?) LINQ provider that works ok for my purposes, but there's a number of quirks I'd like to address, but I'm not sure how. For example: // performing projection with Linq-to-Objects, since Linq-to-Sage won't handle this: var vendorCodes = context.Vendors.ToList().Select(e => e.Key); My IQueryProvider implementation had a CreateQuery<TResult>

如何制作LINQ

我已经实现了一个基本的(天真的)LINQ提供程序,它可以用于我的目的,但我想解决一些怪癖,但我不知道如何。 例如: // performing projection with Linq-to-Objects, since Linq-to-Sage won't handle this: var vendorCodes = context.Vendors.ToList().Select(e => e.Key); 我的IQueryProvider实现有一个CreateQuery<TResult>实现,如下所示: public IQueryable<TResult> CreateQuery<TResult>(Exp

Binding a WPF ComboBox to a custom list

I have a ComboBox that doesn't seem to update the SelectedItem/SelectedValue. The ComboBox ItemsSource is bound to a property on a ViewModel class that lists a bunch of RAS phonebook entries as a CollectionView. Then I've bound (at separate times) both the SelectedItem or SelectedValue to another property of the ViewModel. I have added a MessageBox into the save command to debug the v

将WPF组合框绑定到自定义列表

我有一个ComboBox似乎没有更新SelectedItem / SelectedValue。 ComboBox ItemsSource绑定到ViewModel类的属性,该类将一大堆RAS电话簿条目列为CollectionView。 然后我将SelectedItem或SelectedValue绑定到ViewModel的另一个属性(在不同的时间)。 我在save命令中添加了一个MessageBox来调试由数据绑定设置的值,但未设置SelectedItem / SelectedValue绑定。 ViewModel类看起来像这样: public ConnectionViewModel {

C# XML Writer Format AmazonEnvelope for AU Scratchpad

OK so I'm trying to format this XML element so that it looks like this: <AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> This is the code I have so far: writer.WriteAttributeString("xsi", "noNamespaceSchemaLocation", null, "amzn-envelope.xsd"); writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/

用于AU Scratchpad的C#XML Writer格式化AmazonEnvelope

好,所以我试图格式化这个XML元素,使它看起来像这样: <AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 这是我迄今为止的代码: writer.WriteAttributeString("xsi", "noNamespaceSchemaLocation", null, "amzn-envelope.xsd"); writer.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance"); 现在

Navigate to other page IocContainers and MVVM light

I'm making a windows universal 10 application with MVVM light. But now I will, if I click on an item on the ShowWeatherPage be navigate to ShowWeatherDetailPage for more details about the clicked item. But I don't know how I can do this. Can you help me to do this? Below you can find my code. I use IocContainers and for each page a viewmodel and only command bindings. IocContainer

导航到其他页面IocContainers和MVVM灯

我正在用MVVM light制作一个windows universal 10应用程序。 但现在,如果点击ShowWeatherPage上的项目, ShowWeatherPage导航到ShowWeatherDetailPage以获取有关单击项目的更多详细信息。 但我不知道我该如何做到这一点。 你能帮我做这个吗? 下面你可以找到我的代码。 我使用IocContainers,并为每个页面一个视图模型,只有命令绑定。 IocContainerpublic class IocContainer { static IocContainer() {

Can't include extended WPF

I would like to use the extended wpf toolkik(https://wpftoolkit.codeplex.com/) but I am too stupid to include it. I followed these steps: Reference the binaries in your project: Reference WPFToolkit.Extended.dll in your project (Xceed.Wpf.DataGrid.dll for the datagrid control) Add a using statement ("using Xceed.Wpf.Toolkit;" for most of the controls, "using Xceed.Wpf.DataG

不能包含扩展的WPF

我想使用扩展的wpf toolkik(https://wpftoolkit.codeplex.com/),但我太愚蠢,不能包含它。 我遵循这些步骤: 在项目中引用二进制文件: 在项目中引用WPFToolkit.Extended.dll(用于datagrid控件的Xceed.Wpf.DataGrid.dll) 为大多数控件添加using语句(对于数据网格控件,使用Xceed.Wpf.DataGrid;)将“using Xceed.Wpf.Toolkit;”添加到.cs文件的顶部 为大多数控件添加新的xmlns(xmlns:xctk =“http://schemas.xcee

use Controls on Designer

I have problems to use the Extended WPF Toolkit controls in the XAML designer environmet: Win8.1, WPF Toolkit 2.1.0.0, MS VisualStudio Express 2013 What have I done? - Downlod the actual "Extended WPF Toolkit Binaries" from Codeplex-Homepage, unzip.... - include the Xceed.Wpf.Toolkit in my project - referencies ( ok ) - in Toolbox: Add a new Tab "WPF Toolkit Extended" ( ok )

在Designer上使用控件

我在使用XAML设计器environmet中的Extended WPF Toolkit控件时遇到了问题:Win8.1,WPF Toolkit 2.1.0.0,MS VisualStudio Express 2013我做了什么? - 下载来​​自Codeplex-Homepage的实际“扩展WPF工具包二进制文件”,unzip .... - 在我的项目中包含Xceed.Wpf.Toolkit - 引用(ok) - 工具箱中:添加一个新选项卡“WPF Toolkit Extended”(好的) - 在新的注册卡:添加项目。 我看到所有大约70个海关控件(例如SingleUpDown

where are the tools?

Steps I've taken: I'm using .NET 4.0 I've got to codeplex and downloaded the first "Extended WPF Toolkit Binaries". Number 2 added this file "ExtendedWPFToolkit_Binaries.zip" to here: C:UsersmyNameDownloads I then extracted the .dll file and put it here: C:downloadsWPFToolkit.Extended.dll In the WPF project I Browsed (ie to the dll in step 4) for an extra

工具在哪里?

我采取的步骤: 我正在使用.NET 4.0 我必须编码并下载第一个“扩展WPF工具包二进制文件”。 Number 2将此文件“ExtendedWPFToolkit_Binaries.zip”添加到此处:C: Users myName Downloads 然后我解压缩.dll文件并将其放在此处:C: downloads WPFToolkit.Extended.dll 在WPF项目中,我浏览了(例如,第4步中的dll)以获得额外的参考,现在它有一个额外的参考“WPFToolkit.Extended 在MainWindow.xaml.cs文件中,我已

ShowHelp function fail notification

I am newbie in C# and working for utility to verify topic ID content of help files. Following function is useful for me to launch help file: Help.ShowHelp(this, HelpFile.Text, HelpNavigator.TopicId, topicIDStr); In case Help.ShowHelp() function failed to launch .CHM (Help file) with provided CHM file and topic id, then i need to provide notification to user about launch failure. Following i

ShowHelp函数失败通知

我是C#中的新手,并且正在为实用工具验证帮助文件的主题ID内容。 以下功能对我启动帮助文件非常有用: Help.ShowHelp(this, HelpFile.Text, HelpNavigator.TopicId, topicIDStr); 如果Help.ShowHelp()函数无法使用提供的CHM文件和主题ID启动.CHM(帮助文件),那么我需要向用户提供关于启动失败的通知。 以下是伪代码示例: If Help.ShowHelp() failed { Messagebox("Failed to launch help") } 我在网上搜索,但

What is POCO in Entity Framework?

I just started learning POCO but cannot understand its use and advantage. Even following link of stackoverflow did not help me. what is Entity Framework with POCO Can anybody explain the usage of POCO with a simple example? POCOs(Plain old CLR objects) are simply entities of your Domain. Normally when we use entity framework the entities are generated automatically for you. This is great

实体框架中的POCO是什么?

我刚开始学习POCO,但无法理解它的用途和优势。 即使以下链接的stackoverflow没有帮助我。 什么是实体框架与POCO 任何人都可以用一个简单的例子来解释POCO的用法吗? POCO(简单的旧CLR对象)只是您的域的实体。 通常,当我们使用实体框架时,实体会自动为您生成。 这很好,但不幸的是,这些实体与数据库访问功能交织在一起,这显然违背了SOC(分离关注)。 POCO是没有任何数据访问功能的简单实体,但仍具有所有Entity