Active Directory可以根据jpegPhoto属性定义以JPEG文件交换格式(JFIF)存储图像.我想用这个,但我从来没有听说过JFIF.
首先,所有JPEG文件都是JFIF吗?
第二,WPF JpegBitmapEncoder是否会生成JFIF文件?我想如果第一个是真的,这将是但如果它不是......?
我希望能够在Silverlight 3.0 DataGrid中选择一个特定的单元格并将其置于编辑模式.我可以使用VisualTreeManager来定位单元格.如何切换到编辑模式?
每个DataGridCell在VisualTreeManager中都是这样的:
System.Windows.Controls.DataGridCell
System.Windows.Controls.Grid
System.Windows.Shapes.Rectangle
System.Windows.Controls.ContentPresenter
System.Windows.Controls.TextBlock
System.Windows.Shapes.Rectangle
System.Windows.Shapes.Rectangle
Run Code Online (Sandbox Code Playgroud)
使用包含我要编辑的文本的TextBlock.
更新
按照@AnthonyWJones的建议,这是我尝试使用BeginEdit()的方法.
我想保持简单,所以我想我会在第一行选择一列.即使这证明超出了我的SL知识!最后,我通过创建一个名为firstRow的字段来保存第一行:
private DataGridRow firstRow;
Run Code Online (Sandbox Code Playgroud)
向DataGrid添加了一个LoadingRow处理程序:
LoadingRow="computersDataGrid_LoadingRow"
Run Code Online (Sandbox Code Playgroud)
和
private void computersDataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
if (this.firstRow == null)
this.firstRow = e.Row;
}
Run Code Online (Sandbox Code Playgroud)
然后向面板添加一个按钮以触发编辑:
private void Button_Click(object sender, RoutedEventArgs e)
{
this.dataGrid.SelectedItem = this.firstRow;
this.dataGrid.CurrentColumn = this.dataGrid.Columns[4];
this.dataGrid.BeginEdit();
}
Run Code Online (Sandbox Code Playgroud)
我单击按钮并选择了正确的单元格,但它不会在单元格上进行编辑.需要手动点击才能实现这一目标.
那里的Portable Class Library相当于MethodBase.GetCurrentMethod?
我是PCL的新手.我只是在研究是否可以使用PCL来保存一些肯定会在Silverlight上使用的客户端代码,并且可以在其他地方使用.扫描完源代码后,我可以看到很多对MethodBase.GetCurrentMethod的调用,这些调用似乎不存在于PCL中.
**编辑**
我已经将这个样本从有问题的库中删除了.IsNullOrEmpty()使用的是String.IsNullOrWhiteSpace(String),它似乎不可用,因此该位是一个软糖.
using System;
using System.Linq;
using System.Reflection;
using System.Linq.Expressions;
namespace LinqToLdap.PCL
{
public static class QueryableExtensions
{
internal static bool IsNullOrEmpty(this String str)
{
return string.IsNullOrEmpty(str);
}
public static IQueryable<TSource> FilterWith<TSource>(this IQueryable<TSource> source, string filter)
{
if (source == null) throw new ArgumentNullException("source");
if (filter.IsNullOrEmpty()) throw new Exception("Filters cannot be null, empty, or white-space.");
if (!filter.StartsWith("("))
{
filter = "(" + filter + ")";
}
return source.Provider.CreateQuery<TSource>(
Expression.Call(
null,
((MethodInfo)MethodBase.GetCurrentMethod())
.MakeGenericMethod(new[] { typeof(TSource) }),
new[] …Run Code Online (Sandbox Code Playgroud) 0x80040154的System.Runtime.InteropServices.COMException是否始终表示该类未注册?我收到一个COMException,其中显示"由于以下错误,检索具有CLSID {29131539-2EED-1069-BF5D-00DD011186B7}的组件的COM类工厂失败:80040154." 它正在尝试加载Interop.Domino.dll,这是我从Add Reference的COM选项卡中获得的一个名为"Lotus Domino Objects"的引用,它指向Notes程序文件夹中的domobj.tlb.
我几年前写过代码 - 这是我用互操作做的唯一一件事,可以说我从来没有真正掌握它.
将代码移动到2008 R2服务器后,我再次看到此错误(因此它是x64).它是在XP上编写的,并在2003年运行(均为x86).为了诊断问题,我构建了一个Win7 x86(因为没有R2 x86)框并且它有效.我还构建了一个2003 x64的盒子,它失败并出现相同的错误,因此看起来它是由于迁移到x64架构造成的.在进行互操作以使x86 COM DLL在x64机器上工作时,我应该做些什么?
当您有长时间运行的工作流时,如何管理WF中的工作流版本,并且您可能同时在持久性存储中有两个或三个版本并且必须能够全部访问它们?
WHERE在SELECT语句中的GROUP BY之前被处理.如何在COUNT(名称)的结果上使用WHERE?
我想要的是这个:
SELECT topic, COUNT(name) AS counter
FROM blah
GROUP BY name
WHERE counter <> 1
Run Code Online (Sandbox Code Playgroud) 我正在尝试在代码中打开names.nsf.这段代码已经工作了一段时间,但突然间,我变得空了.知道为什么吗?我似乎没有得到任何错误,我不知道如何弄清楚什么是错的.
我可以在同一台机器上从Notes客户端打开数据库.
UPDATE
这是代码.字段在构造函数中初始化.空引用发生在.IsOpen()消息上.
public class DominoPersonSearcher
{
private string _serverName;
private string _databaseFileName;
private string _password;
private Domino.NotesDatabase OpenDatabase(out Domino.NotesSession notesSession)
{
notesSession = new Domino.NotesSessionClass();
notesSession.Initialize(this._password);
Domino.NotesDatabase notesDatabase;
notesDatabase = notesSession.GetDatabase(this._serverName, this._databaseFileName, false);
if (!(notesDatabase.IsOpen))
{
notesDatabase.Open();
}
return notesDatabase;
}
Run Code Online (Sandbox Code Playgroud)
此代码是C#并在Web服务器上运行; 它不在数据库中 - 它在Notes之外运行,只是调用它.我已多次使用这种确切的机制.它使用名为Interop.Domino.dll的Lotus Domino Objects COM C:\notes\domobj.tlb的.NET包装器.Domino安装在不同的服务器上.
我想从Notes数据库中获取所有冲突文档.到目前为止,我有这个:
Domino.NotesSession notesSession;
Domino.NotesDatabase notesDatabase = this.OpenDatabase(out notesSession);
Domino.NotesDateTime dateTime = notesSession.CreateDateTime(String.Empty);
Domino.NotesDocumentCollection results =
notesDatabase.Search(this.SearchString, dateTime, 0);
Run Code Online (Sandbox Code Playgroud)
它适用于,例如:
searchString = "@Contains(ShortName;\"Bob\")";
Run Code Online (Sandbox Code Playgroud)
我如何为冲突文件做相同的工作?
lotus-domino ×3
lotus-notes ×3
.net ×1
64-bit ×1
c# ×1
com-interop ×1
datagrid ×1
jpeg ×1
persistence ×1
silverlight ×1
sql ×1
versioning ×1
wpf ×1