public IDocument OpenDocument(Uri uri, ISledDocumentClient client) { var sd = SledDocument.Create(uri, client); sd.Read(); // Let the control do it itself; it will also // supply an icon if the document is readonly. sd.RegisterControl(); if (sd.Editor != null) { sd.Editor.FileDragDropped += SledDocumentEditorFileDragDropped; } return(sd); }
private static bool CanGetSourceControlToCheckOut(SledDocument sd) { if (sd == null) { return(false); } var sourceControlService = SledServiceInstance.TryGet <SledSourceControlService>(); if (sourceControlService == null) { return(false); } var context = new SledDocumentSourceControlContext(sd); return (sourceControlService.CanDoCommand(SledSourceControlCommand.CheckOut, context) && sourceControlService.DoCommand(SledSourceControlCommand.CheckOut, context)); }
public SledDocumentSourceControlContext(SledDocument sd) { m_sd = sd; }