Exemplo n.º 1
0
        void OnDocumentChanged(object sender, EventArgs e)
        {
            DefaultDocument t = (DefaultDocument)this.Document;

            //this.Document.LineSegmentCollection[this.ActiveTextAreaControl.Caret.Line].Modified = true;
            //this.ActiveTextAreaControl.TextArea.GutterMargin.
            OnTextChanged(e);
        }
 /// <summary>
 /// Creates a new instance of <see cref="DefaultSelection"/>
 /// </summary>
 /// <param name="document">The document.</param>
 /// <param name="startPosition">The start position.</param>
 /// <param name="endPosition">The end position.</param>
 public DefaultSelection(IDocument document, TextLocation startPosition, TextLocation endPosition)
 {
     DefaultDocument.ValidatePosition(document, startPosition);
     DefaultDocument.ValidatePosition(document, endPosition);
     Debug.Assert(startPosition <= endPosition);
     this.document      = document;
     this.startPosition = startPosition;
     this.endPosition   = endPosition;
 }
Exemplo n.º 3
0
		/// <remarks>
		/// Creates a new <see cref="IDocument"/> object. Only create
		/// <see cref="IDocument"/> with this method.
		/// </remarks>
		public IDocument CreateDocument() {
			DefaultDocument doc = new DefaultDocument();
			doc.TextBufferStrategy = new GapTextBufferStrategy();
			doc.FormattingStrategy = new DefaultFormattingStrategy();
			doc.LineManager = new LineManager(doc, null);
			doc.FoldingManager = new FoldingManager(doc, doc.LineManager);
			doc.FoldingManager.FoldingStrategy = null; //new ParserFoldingStrategy();
			doc.MarkerStrategy = new MarkerStrategy(doc);
			doc.BookmarkManager = new BookmarkManager(doc, doc.LineManager);
			return doc;
		}
Exemplo n.º 4
0
        public async Task <ActionResult> Process()
        {
            var message = await _sqsService.GetMessageAsync();

            var document = new DefaultDocument {
                Message = message.Body, Id = Guid.NewGuid(), Version = 1
            };
            await _mongoService.WriteDocumentAsync(document);

            return(RedirectToAction("Index"));
        }
 /// <summary>
 /// Creates a new document.
 /// </summary>
 /// <returns>The new document.</returns>
 public IDocument CreateDocument()
 {
     DefaultDocument document = new DefaultDocument();
       document.TextBufferStrategy = new GapTextBufferStrategy();
       document.FormattingStrategy = new DefaultFormattingStrategy();
       document.LineManager = new LineManager(document, null);
       document.FoldingManager = new FoldingManager(document);
       document.FoldingManager.FoldingStrategy = null;
       document.MarkerStrategy = new MarkerStrategy(document);
       document.BookmarkManager = new BookmarkManager(document);
       return document;
 }
Exemplo n.º 6
0
        /// <summary>
        /// Initiates the server configuration and applications configuration.
        /// </summary>
        private void Init()
        {
            Console.WriteLine("+-+-+ INITIATING CONFIGURATION MANAGER +-+-+");
            Console.WriteLine("-- Loading configuration from JSON configuration file...");
            // Getting general JSON string from file
            JObject configJson = JsonConvert.DeserializeObject(File.ReadAllText(_path)) as JObject;

            // Assigning port from JSON
            Port = int.Parse(configJson["port"].ToString());

            // Populating defaultDocument List
            foreach (var document in configJson["defaultDocument"] as JArray)
            {
                DefaultDocument.Add(document.ToString());
            }

            // Populating errorPages Dictionary
            JProperty property;

            foreach (var token in configJson["errorPages"] as JArray)
            {
                property = token.First.Value <JProperty>();
                ErrorPages.Add(int.Parse(property.Name), property.Value.ToString());
            }

            // Populatin sites Struct List
            Site site = new Site();

            foreach (var token in configJson["sites"] as JArray)
            {
                site.DefaultDocument   = new List <string>();
                site.ErrorPages        = new Dictionary <int, string>();
                site.Name              = token["name"].ToString();
                site.PhysicalPath      = token["physicalPath"].ToString();
                site.VirtualPath       = token["virtualPath"].ToString();
                site.DirectoryBrowsing = bool.Parse(token["directoryBrowsing"].ToString());

                foreach (var document in token["defaultDocument"] as JArray)
                {
                    site.DefaultDocument.Add(document.ToString());
                }

                foreach (var pages in token["errorPages"] as JArray)
                {
                    property = pages.First.Value <JProperty>();
                    site.ErrorPages.Add(int.Parse(property.Name), property.Value.ToString());
                }

                Sites.Add(site);
            }

            //Printing Config
            Console.WriteLine("  + Port: {0}", Port);
            foreach (var document in DefaultDocument)
            {
                Console.WriteLine("  + Default Document: {0}", document);
            }
            foreach (var page in ErrorPages)
            {
                Console.WriteLine("  + Error Page: {0}", page);
            }
            int i = 0;

            foreach (var s in Sites)
            {
                Console.WriteLine("  + Site [{0}] | Name: {1}", i, s.Name);
                Console.WriteLine("  + Site [{0}] | Physical Path: {1}", i, s.PhysicalPath);
                Console.WriteLine("  + Site [{0}] | Virtual Path: {1}", i, s.VirtualPath);
                Console.WriteLine("  + Site [{0}] | Directory Browsing: {1}", i, s.DirectoryBrowsing);
                foreach (var document in s.DefaultDocument)
                {
                    Console.WriteLine("  + SiteDocument: {0}", document);
                }
                foreach (var pages in s.ErrorPages)
                {
                    Console.WriteLine("  + SiteErrorPage: {0}", pages);
                }
                i++;
            }
            Console.WriteLine("-- Configuration Loading COMPLETE!");
            Console.WriteLine("-");
        }