.net
文章平均质量分 77
天涯海角
专注于SharePoint,BI 及.net平台的一码农。
展开
-
SharePoint 2013 中文站点更新列表字段的标题(Title)不能work
本文讲述SharePoint 2013 中文站点更新列表字段的标题(Title)不能work的解决方案原创 2014-05-14 20:59:25 · 2085 阅读 · 0 评论 -
WPF 和 Silverlight 的异同点
本文讨论WPF 和 Silverlight 的异同点, WPF 为微软主推的桌面应用程序(多为C/S结构)技术平台,而Silverlight是微软主推富客户端网页应用程序(多为B/S结构)技术平台。 1. WPF 和Silverlight的类似点:a. 都是支持Xaml 语言的b. 都支持 DEPENDENCY PROPERTIESc. 都支持通用原创 2012-02-26 15:53:47 · 1449 阅读 · 0 评论 -
Working With The WPF Dispatcher
Proper use of threads can greatly increase the responsiveness of your WPF applications. Unfortunately, you can't update any UI controls from a thread that doesn't own the control. In .NET 2.0, you u转载 2012-02-20 15:24:30 · 1246 阅读 · 0 评论 -
WPF Image element locks my local file
WPF Image element locks my local file When using the Image element and specifying a local resource Uri in the Source attribute that resource will be locked by your application's process.转载 2012-02-17 10:51:06 · 1326 阅读 · 0 评论 -
在WPF 中使用 BackgroundWorker
1. MainWindow.xaml <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/x原创 2012-02-18 21:38:09 · 5160 阅读 · 0 评论 -
How to stop the gridspliter when the height or width reach the thresholds
1. Declare three private fieldsprivate double scrollChange;private double widthThreshold = 100;private double heightThreshold = 100; 2. Add the events for gridspliter For how to d原创 2012-02-24 08:41:17 · 1030 阅读 · 0 评论 -
Let the ListViewItem wdith update according to the ListView's width
1. Add this code in the control load Decorator borderForSourceListView = VisualTreeHelper.GetChild(this.sourceListView, 0) as Decorator; ScrollViewer scrollViewerForSourceListView = bo原创 2012-02-22 10:34:14 · 677 阅读 · 0 评论 -
How to register a keyboard shortcut (hot key) in a .NET Windows Forms Application
转自http://windowscoding.com/blogs/blake/archive/2009/05/19/how-to-register-a-keyboard-shortcut-hot-key-in-a-net-windows-forms-application.aspx1. WPF solution public WindowMain() {转载 2012-01-29 22:08:39 · 867 阅读 · 0 评论 -
Forcing WPF to use a specific Windows theme
WPF comes with a few theme assemblies, one for each Windows theme (Luna, Royale and Aero and the fallback theme, Classic.) Usually the theme is loaded according to your current system theme, but if yo原创 2012-01-14 18:36:57 · 991 阅读 · 0 评论 -
Smooth Pixel Scrolling in WPF ListView / ListBox
WPF comes with lots of fun and advantages. We can change the look and behavior of a control very easily which would have been very cumbersome when we are in normal winforms applications. WPF has few f原创 2012-01-14 18:35:54 · 1798 阅读 · 0 评论 -
WPF 继承自定义的控件
WPF 继承自定义的控件1.创建一个BaseControl.csnamespace Test.Control{ using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; /// ///原创 2012-01-10 22:14:55 · 6423 阅读 · 1 评论 -
WPF 中资源路径的问题
WPF 中资源路径的问题1. 引用当前工程的资源(注意xxxx.png的build action 应设置为Resource 或Embedded Resource) 2. 引用其它工程的资源 (注意xxxx.png的build action 应设置为Resource 或Embedded Resource) 3. 引用相对路径下的资源(注意最好将xxx.png 的cop原创 2011-12-26 21:31:08 · 7423 阅读 · 2 评论 -
WPF BackgroundWorker vs. Dispatcher
The main difference between the Dispatcher and other threading methods is that the Dispatcher is not actually multi-threaded. The Dispatcher governs the controls, which need a single thread to functio转载 2012-02-20 15:38:28 · 1509 阅读 · 0 评论 -
How can I create a data binding in code using WPF?
When creating UI elements in code it is often necessary to programmatically bind them to data. Fortunately this is relatively straightforward as the following code-snippet using the Binding object fro转载 2012-02-21 16:32:58 · 1076 阅读 · 0 评论 -
C# 读取Excel的剪贴板
1. Form1.Designer.cs, 创建winform应用程序,并在form1中替添加一个button 和一个richtext box:namespace WindowsFormsApplication1{ partial class Form1 { /// /// Required designer variable.原创 2012-03-26 16:38:36 · 4936 阅读 · 0 评论 -
SharePoint 中使用Json传递数据到后台的 ashx
最近项目中遇到需要使用Json传递数据到SharePoint后台的 ashx,goole下方案,但遇到不少问题。最终解决了,把遇到的问题和大家分享下。原创 2014-03-22 09:14:05 · 2462 阅读 · 0 评论 -
在SharePoint 2013/2010 解决方案中添加 ashx (HttpHandler)
在SharePoint 2013/2010 解决方案中添加 ashx (HttpHandler)原创 2014-03-07 22:09:41 · 4312 阅读 · 5 评论 -
SharePoint 2010/2013 创建一个默认值为当前用户的客户化字段
本文讲述如何在SharePoint 2010/2013 中创建一个默认值为当前用户的客户化字段。原创 2014-01-17 20:19:40 · 2340 阅读 · 0 评论 -
SharePoint 2013/2010 使用Silverlight client model
本文讲述如何在SharePoint 2013/2010 中使用Silverlight client object model.SharePoint 2013/2010 提供了client object model,涵盖了多种版本: .net, Javascript, Silverlight等。2013 增加一个新的Object Model: Microsoft.SharePoint.Clie原创 2013-02-26 17:36:01 · 1915 阅读 · 0 评论 -
SharePoint 2013 客户端模型(Client Object Model) 调用搜索(Query Search)
SharePoint 2013 客户端模型(Client Object Model) 调用搜索(Query Search):SharePoint 2013 提供客户端调用Search 模型的方式,方便把SharePoint 搜索和其他系统整合。下面说明如何在一个Asp.net程序中调用SharePoint 搜索: 1. 使用VS2010 新建一个 Asp.net Web Appli原创 2012-12-27 17:34:55 · 4700 阅读 · 1 评论 -
SharePoint server side code use Microsoft.Exchange.WebServices.dll send mail
public static void SendMailByExchange(string from, string to, string serviceUrl, string body, string title, string userName, string password, string domain, bool error) { ExchangeS原创 2012-11-12 20:26:02 · 1908 阅读 · 0 评论 -
Impersonate: use specified credential to execute some code in C#
In some scenarios we need run some code under some specified credential:1. You want to run a windows service which to copy file to a UNC path, but the IT don't let you to use the domain account to r原创 2012-10-25 22:57:28 · 1621 阅读 · 0 评论 -
Power shell Send mail by exchanges server
<# This file is used for Send mail via exchange service owner: farawayplace613, tomcat.cheng@gmail.com date: 2012/08/23#> # Load the Microsoft.Exchange.WebServices.dll which used for commic原创 2012-08-24 14:12:13 · 1406 阅读 · 0 评论 -
Using the Microsoft.SharePoint.Linq
As we know if we want to query some List items with filters, we need to CAML in the Moss 2007.CAML is powerful and has good performance than get all list item and traverse them to get the items whic原创 2012-08-25 15:13:27 · 1138 阅读 · 0 评论 -
Issues when using the Microsoft.Exchange.WebServices.dll connect to Exchange 2010
This article describes how to resolve two issues when using the Microsoft.Exchange.WebServices to send mail 1. Exception Message = "The type initializer for 'Microsoft.Exchange.WebServices.Strin原创 2012-08-24 14:28:43 · 1977 阅读 · 0 评论 -
C# 实现Rest 风格的web服务
C# 实现Rest 风格的web服务REST(Representational State Transfer)是 RoyFielding 提出的一个描述互联系统架构风格的名词。为什么称为REST?Web本质上由各种各样的资源组成,资源由URI 唯一标识。浏览器(或者任何其它类似于浏览器的应用程序)将展示出该资源的一种表现方式,或者一种表现状态。如果用户在该页面中定向到指向其它资源的链接,则将访翻译 2011-10-01 20:34:16 · 12479 阅读 · 11 评论 -
WPF 在ResourceDictionary文件中使用自定的属性作为trigger 的target
1. 定义一个属性DependencyProperty(在对应控件的代码文件中) /// /// Register the Selected to the DependencyProperty /// public static readonly DependencyProperty SelectedProperty =原创 2011-12-25 20:09:46 · 2614 阅读 · 0 评论 -
WPF 中listView.ScrollIntoView失效的问题
使用listView.ScrollIntoView(item) 想让滚动条自动导航到这个item,但如果在单线程中处理这个有时会失灵,就是你明明调用了,但是滚动条没任何反应。问题类似这里提到的http://social.msdn.microsoft.com/Forums/en/wpf/thread/1223c316-c7e2-48ce-a05a-3cd6fa502036解决办法是让另外原创 2011-12-25 19:54:11 · 6003 阅读 · 0 评论 -
WPF 处理RichTextBox, ListView等的Scroll Bar 事件(event)
WPF中没有专门处理RichTextBox, ListView等的Scroll Bar 事件, 但可以通过以下方式来处理1. 注册事件 CommandManager.AddPreviewExecutedHandler(richTextBoxInstance, new ExecutedRoutedEventHandler(OnScorllCommandForRichTextBox)); C原创 2011-12-25 19:44:17 · 4250 阅读 · 0 评论 -
从.net 程序中传递table 参数个存储过程
1.在数据库中创建Type 类型Use TestTVP --假设已经建立了TestTVP 数据库和TestTVP 的schemago--创建TVP CREATE TYPE Test.TestTVP AS TABLE{ SNo varchar(20) Not NULL, SName varchar(50)}go--创建使用TVP的存储过程 Create原创 2009-02-12 19:41:00 · 1285 阅读 · 2 评论 -
SharePoint 2010 自定义状态机工作流(StateMachine Workflow) + InfoPath 实例part2 (InfoPath设计部分及演示效果)
SharePoint 2010 自定义状态机工作流(StateMachine Workflow) + InfoPath 实例part2 (InfoPath设计部分及演示效果)1. 启动 ” MicrosoftInfoPath Designer 2010”2.原创 2011-09-12 21:23:55 · 3030 阅读 · 0 评论 -
利用反射在类外修改private成员
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;using System.ComponentModel;namespace AttributeTest{ public class Program {原创 2009-02-12 18:39:00 · 753 阅读 · 0 评论 -
为SharePoint 2010 Workflow 开发 Custom(自定义的) Workflow Activity
为SharePoint 2010 Workflow 开发 Custom Workflow Activity(Develop Custom Workflow Activity for SharePoint 2010 Workflow). SharePoint2010提供了很多有原创 2011-09-03 23:40:46 · 2750 阅读 · 1 评论 -
使用 SqlInfoMessageEventHandler 获取Sql中print或error消息
我们写Sql存储过程时经常要用print打印出一些信息以供我们调试和Debug存储过程。但是一旦我们的应用程序部署了,为帮助我们快速诊断应用程序的错误,我们想把我们在储过程print的信息记录下来。这样我们就需要从应用程序中获取Sql print的信息了,这里介绍如何使用原创 2011-09-17 12:52:59 · 2346 阅读 · 0 评论 -
Xpath 匹配节点的内容为空(inner text 为空)
需求是从以下写出能从下面的xml中取出Title内容(inner text)为空的节点的XPath: Asp.net22.5Abraham22.5Abraham容易写出错误的xPath有://Book[Title[text()='']] /原创 2011-02-17 11:18:00 · 10042 阅读 · 0 评论 -
SharePoint 2010 自定义状态机工作流 (StateMachine Workflow) + InfoPath 实例part1 (工作流实现部分)
SharePoint 2010 自定义状态机工作流(StateMachine Workflow) + InfoPath 实例part1 (工作流实现部分)首先虚拟一个场景,某客户要求基于SharePoint 2010 实现一个招聘工作流。招聘流程需求如下: a.原创 2011-09-12 18:32:03 · 5289 阅读 · 1 评论 -
在 SharePoint 2010 中使用Flash图表控件 Fusion Charts
在 SharePoint 2010 中使用Flash图表控件 Fusion Charts 记得我去年写过一篇blog介绍怎么把当时只适用Moss2007的Flash图表控件 Fusion Charts应用到Moss2010 中http://blog.csdn.n原创 2011-09-15 22:43:43 · 2007 阅读 · 0 评论 -
开发自定义的SharePoint 顺序工作流
假设有这样一个需求:客户需要用Moss2010有个一个请假单(绑定有工作流),有这样几个用户(角色):1.Moss (员工)、2.Leader(组长)、3.Manager(经理)、4.Boss(老板)当员工创建请假单时,启动工作流。工作流具体需求为,当员工新建了一原创 2011-09-07 22:18:57 · 3038 阅读 · 1 评论 -
Using FusionCharts in Moss 2010
UsingFusionCharts in Moss 2010Introduce This document isintroducing how to use FusionCharts in Moss 2010 base on Fusion Charts Free for原创 2010-07-29 11:21:00 · 1588 阅读 · 2 评论 -
使用 SharePoint 2010 Client Object Model 修改用户Email(邮箱) 地址
我们使用SharePoint 2010 时,有时需要修改用户Email(邮箱) 地址,但是People and Groups 这个列表里面不允许我们修改。本文介绍如何使用 Client Object Model 来修改用户Email(邮箱) 地址。关于如何使用Moss 2原创 2011-09-03 10:20:23 · 2419 阅读 · 0 评论