示例#1
0
 internal LimitedDocument(DocumentReference documentReference, bool isReadOnly, Encoding encoding, string contents, EditingService editingService)
     : base(documentReference, isReadOnly)
 {
     this.encoding       = encoding;
     this.contents       = contents;
     this.editingService = editingService;
 }
示例#2
0
        public IEditingService GetViewingService(string rootStoragePath,
                                                 IStorageProvider customStorageProvider,
                                                 string workingDirectoryPath,
                                                 IStorageProvider customWorkingStorageProvider)
        {
            IFileStorage    adapter            = new FileStorageAdapter(customStorageProvider);
            IFileStorage    tempStorageAdapter = new FileStorageAdapter(customWorkingStorageProvider);
            IEditingService viewingService     = new EditingService(rootStoragePath, adapter, workingDirectoryPath, tempStorageAdapter);

            return(viewingService);
        }
示例#3
0
        internal LimitedDocumentView(IDocument document, EditingService editingService)
            : base(document)
        {
            LimitedDocument limitedDocument = (LimitedDocument)document;

            this.codeEditor = editingService.CreateCodeEditor(limitedDocument.TextBuffer);
            foreach (DictionaryEntry dictionaryEntry in this.codeEditor.GetEditCommands())
            {
                this.AddCommand((string)dictionaryEntry.Key, (ICommand)dictionaryEntry.Value);
            }
            foreach (DictionaryEntry dictionaryEntry in this.codeEditor.GetUndoCommands())
            {
                this.AddCommand((string)dictionaryEntry.Key, (ICommand)dictionaryEntry.Value);
            }
        }
示例#4
0
        private IEditingService GetViewingServiceForOptions(IStorageProvider customStorageProvider,
                                                            IStorageProvider customTempStorageProvider,
                                                            SupportedStorageProvider storageProvider,
                                                            Hashtable options,
                                                            string rootStoragePath, string workingFolder)
        {
            IEditingService viewingService;

            if (customStorageProvider == null)
            {
                switch (storageProvider)
                {
                case SupportedStorageProvider.Local:
                    viewingService = new EditingService(rootStoragePath, workingFolder);
                    break;

                default:
                    object sourceBucketNameObject = null, cacheBucketNameObject = null;
                    string sourceBucketName = null, cacheBucketName = null;
                    if (options != null)
                    {
                        sourceBucketNameObject = options[CommonConstants.BucketNameKey];
                        if (sourceBucketNameObject != null)
                        {
                            sourceBucketName = (string)sourceBucketNameObject;
                        }

                        cacheBucketNameObject = options[CommonConstants.CacheBucketNameKey];
                        if (cacheBucketNameObject != null)
                        {
                            cacheBucketName = (string)cacheBucketNameObject;
                            options[CommonConstants.DownloadFolderForCacheStorageKey] = Path.Combine(_downloadPath,
                                                                                                     cacheBucketName);
                        }
                        options[CommonConstants.CacheFolderKey] = Path.Combine(_downloadPath, sourceBucketName);
                    }
                    viewingService = new EditingService(rootStoragePath, (byte)storageProvider, options,
                                                        cacheBucketName);
                    break;
                }
            }
            else
            {
                viewingService = GetViewingService(rootStoragePath, customStorageProvider, workingFolder, customTempStorageProvider);
            }
            return(viewingService);
        }
示例#5
0
 public LimitedDocumentType(EditingService editingService)
 {
     this.editingService = editingService;
 }
示例#6
0
 public XmlDocumentType(EditingService editingService)
     : base(editingService)
 {
 }
示例#7
0
 public LimitedXamlDocumentType(EditingService editingService)
     : base(editingService)
 {
 }
示例#8
0
 public HTMLDocumentType(EditingService editingService)
     : base(editingService)
 {
 }
示例#9
0
 public CodeOptionsPage(EditingService editingService)
 {
     this.editingService = editingService;
 }