Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 public SledDocumentSourceControlContext(SledDocument sd)
 {
     m_sd = sd;
 }