Пример #1
0
        public override void Visit(SectionTitle sectionTitle)
        {
            if (sectionTitle.Level != 2)
            {
                base.Visit(sectionTitle);
                return;
            }

            // Generate an anchor for all Level 2 section titles
            if (!sectionTitle.Attributes.HasAnchor)
            {
                var builder = new StringBuilder();
                using (var writer = new AsciiDocVisitor(new StringWriter(builder)))
                {
                    writer.Visit((InlineContainer)sectionTitle);
                }

                var title = builder.ToString().PascalToHyphen();
                sectionTitle.Attributes.Add(new Anchor(title));
            }

            // Check for duplicate ids across documents
            var    key = sectionTitle.Attributes.Anchor.Id;
            string existingFile;

            if (Ids.TryGetValue(key, out existingFile))
            {
                throw new Exception($"duplicate id {key} in {_destination.FullName}. Id already exists in {existingFile}");
            }

            Ids.Add(key, _destination.FullName);
            base.Visit(sectionTitle);
        }
        public override void VisitSectionTitle(SectionTitle sectionTitle)
        {
            // Generate an anchor for all top level section titles
            if (this._document.IndexOf(sectionTitle) == 0 && !sectionTitle.Attributes.HasAnchor)
            {
                var builder = new StringBuilder();
                using (var writer = new AsciiDocVisitor(new StringWriter(builder)))
                {
                    writer.VisitInlineContainer(sectionTitle);
                }

                var title = builder.ToString().PascalToHyphen();
                sectionTitle.Attributes.Add(new Anchor(title));
            }

            if (sectionTitle.Attributes.HasAnchor)
            {
                // Check for duplicate ids across documents
                var key = sectionTitle.Attributes.Anchor.Id;
                if (Ids.TryGetValue(key, out var existingFile))
                {
                    throw new Exception($"duplicate id {key} in {_destination.FullName}. Id already exists in {existingFile}");
                }

                Ids.Add(key, _destination.FullName);
            }

            base.VisitSectionTitle(sectionTitle);
        }
Пример #3
0
        void GetLaguageStrings()
        {
            SectionTitle.Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSMailTitle", ""));
            SectionTitle.Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSCalendar", ""));
            SectionTitle.Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Order", ""));
            SectionTitle.Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Notes", ""));
            SectionTitle.Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Logout", ""));

            RowsTitle[0].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSInbox", ""));
            RowsImgs[0].Add(UIImage.FromBundle("Inbox"));

            RowsTitle[0].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSDrafts", ""));
            RowsImgs[0].Add(UIImage.FromBundle("Drafts"));

            RowsTitle[0].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSSent", ""));
            RowsImgs[0].Add(UIImage.FromBundle("Sent"));

            RowsTitle[0].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("LSTrash", ""));
            RowsImgs[0].Add(UIImage.FromBundle("Trash"));

            RowsTitle[1].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("List", ""));
            RowsImgs[1].Add(UIImage.FromBundle("Calendar"));

            RowsTitle[1].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Add", ""));
            RowsImgs[1].Add(UIImage.FromBundle("CalendarAdd"));


            RowsTitle[2].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("View Order", ""));
            RowsImgs[2].Add(UIImage.FromBundle("Orders"));

            RowsTitle[2].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Amend Order", ""));
            RowsImgs[2].Add(UIImage.FromBundle("OrderAmend"));

            RowsTitle[2].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Create Order", ""));
            RowsImgs[2].Add(UIImage.FromBundle("OrderAdd"));

            RowsTitle[2].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Convert Order", ""));
            RowsImgs[2].Add(UIImage.FromBundle("OrderConvert"));

            RowsTitle[2].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Delete Order", ""));
            RowsImgs[2].Add(UIImage.FromBundle("Trash"));


            RowsTitle[3].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("View Notes", ""));
            RowsImgs[3].Add(UIImage.FromBundle("Notes"));

            RowsTitle[3].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Amend Notes", ""));
            RowsImgs[3].Add(UIImage.FromBundle("NotesAmend"));

            RowsTitle[3].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Create Notes", ""));
            RowsImgs[3].Add(UIImage.FromBundle("NotesAdd"));

            RowsTitle[3].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Delete Notes", ""));
            RowsImgs[3].Add(UIImage.FromBundle("NotesDelete"));

            RowsTitle[4].Add(IosUtils.LocalizedString.sharedInstance.GetLocalizedString("Log Out", ""));
            RowsImgs[4].Add(UIImage.FromBundle("Logout"));

            IBContntTbl.ReloadData();
        }
Пример #4
0
        private IEnumerator AparicionDelTituloSinRozamiento()
        {
            Text titulo = SectionTitle.GetComponent <Text>();

            titulo.text = "Sin rozamiento";
            yield return(StartCoroutine(FadingEffects.ShowAndHideTextFading(0.5f, 1f, titulo)));
        }
Пример #5
0
        private IEnumerator AparicionDelTituloVelocidadMaxima()
        {
            Text titulo = SectionTitle.GetComponent <Text>();

            titulo.text = "Velocidad máxima";
            yield return(StartCoroutine(FadingEffects.ShowAndHideTextFading(0.5f, 1f, titulo)));
        }
Пример #6
0
        public static List<SectionTitleCollection> LoadCatalog(XElement rootXE)
        {
            //doc1.Sects.Clear();
            Dictionary<int, SectionTitle> cacheDic = new Dictionary<int, SectionTitle>();
            cacheDic[0] = new SectionTitle();
            if (rootXE != null)
            {
                foreach (var e1 in rootXE.Elements())
                {
                    List<string> l1 = e1.Attributes().Select(a1 => a1.Name.LocalName).ToList<string>();
                    int p = (int)e1.Attribute("porder");
                    int o = (int)e1.Attribute("order");
                    string id = (string)e1.Attribute("id");
                    SectionTitle st1 = new SectionTitle()
                    {
                        OrderFormat = (string)e1.Attribute("orderFormat"),
                        OrderType = (string)e1.Attribute("orderType"),
                        TitleText = e1.Value,
                        ID = id,
                        ModuleID = id,
                        NavID = (string)e1.Attribute("nav"),
                        Code = (string)e1.Attribute("aid"),
                        Tip = (string)e1.Attribute("tip"),
                        Expand = (bool?)e1.Attribute("expand"),
                        Selected = (bool?)e1.Attribute("isSelected")
                    };
                    if (l1.Contains("isCustom"))
                    {
                        st1.IsCustom = (bool)e1.Attribute("isCustom");
                        st1.SectionElementString = (string)e1.Attribute("sectElement");
                    }
                    if (l1.Contains("isVisible"))
                    {
                        st1.IsVisiable = (bool)e1.Attribute("isVisible");
                    }
                    if (l1.Contains("ShowState"))
                    {
                        st1.ShowState = (SectionTitleShowState)Enum.Parse(typeof(SectionTitleShowState), (string)e1.Attribute("ShowState"));
                    }
                    if (cacheDic.ContainsKey(p))
                    {
                        cacheDic[p].Children.Add(st1);
                        //sec1.Parent = cacheDic[p];
                    }
                    cacheDic[p + 1] = st1;
                    // doc1.Sects[id] = st1;
                }

                List<SectionTitleCollection> docTitles = new List<SectionTitleCollection>();

                docTitles.AddRange(from c1 in cacheDic[0].Children
                                   select new SectionTitleCollection() { c1 });
                return docTitles;
            }
            return null;
        }
Пример #7
0
        public override void Visit(Document document)
        {
            _newDocument = new Document
            {
                Title   = document.Title,
                DocType = document.DocType
            };

            foreach (var authorInfo in document.Authors)
            {
                _newDocument.Authors.Add(authorInfo);
            }

            RemoveDocDirectoryAttribute(_newDocument);
            RemoveDocDirectoryAttribute(document);

            foreach (var attributeEntry in document.Attributes)
            {
                _newDocument.Attributes.Add(attributeEntry);
            }

            if (document.Attributes.All(a => a.Name != "ref_current"))
            {
                _newDocument.Attributes.Add(new AttributeEntry("ref_current", "https://www.elastic.co/guide/en/elasticsearch/reference/master"));
            }

            if (document.Attributes.All(a => a.Name != "github"))
            {
                _newDocument.Attributes.Add(new AttributeEntry("github", "https://github.com/elastic/elasticsearch-net"));
            }

            if (document.Attributes.All(a => a.Name != "nuget"))
            {
                _newDocument.Attributes.Add(new AttributeEntry("nuget", "https://www.nuget.org/packages"));
            }

            // see if the document has some kind of top level title and add one with an anchor if not.
            if (document.Title == null && document.Count > 0)
            {
                var sectionTitle = document[0] as SectionTitle;

                if (sectionTitle == null || sectionTitle.Level != 2)
                {
                    var id    = Path.GetFileNameWithoutExtension(_destination.Name);
                    var title = id.LowercaseHyphenToPascal();
                    sectionTitle = new SectionTitle(title, 2);
                    sectionTitle.Attributes.Add(new Anchor(id));

                    _newDocument.Add(sectionTitle);
                }
            }

            base.Visit(document);
        }
		public override void Visit(Document document)
		{
			_newDocument = new Document
			{
				Title = document.Title,
				DocType = document.DocType
			};

			foreach (var authorInfo in document.Authors)
			{
				_newDocument.Authors.Add(authorInfo);
			}

			RemoveDocDirectoryAttribute(_newDocument);
			RemoveDocDirectoryAttribute(document);

			foreach (var attributeEntry in document.Attributes)
			{
				_newDocument.Attributes.Add(attributeEntry);
			}

			if (!document.Attributes.Any(a => a.Name == "ref_current"))
			{
				_newDocument.Attributes.Add(new AttributeEntry("ref_current", "https://www.elastic.co/guide/en/elasticsearch/reference/current"));
			}

			if (!document.Attributes.Any(a => a.Name == "github"))
			{
				_newDocument.Attributes.Add(new AttributeEntry("github", "https://github.com/elastic/elasticsearch-net"));
			}

			if (!document.Attributes.Any(a => a.Name == "nuget"))
			{
				_newDocument.Attributes.Add(new AttributeEntry("nuget", "https://www.nuget.org/packages"));
			}

			// see if the document has some kind of top level title and add one with an anchor if not.
			if (document.Title == null && document.Count > 0)
			{
				var sectionTitle = document[0] as SectionTitle;

				if (sectionTitle == null || sectionTitle.Level != 2)
				{
					var id = Path.GetFileNameWithoutExtension(_destination.Name);
					var title = id.LowercaseHyphenToPascal();
					sectionTitle = new SectionTitle(title, 2);
					sectionTitle.Attributes.Add(new Anchor(id));

					_newDocument.Add(sectionTitle);
				}
			}

			base.Visit(document);
		}
        private SectionTitle CreateSubsectionTitle(string title)
        {
            var level        = _topSectionTitleLevel + 1;
            var sectionTitle = new SectionTitle(title, level);

            // levels 1-3 need to be floating so the Elasticsearch docs generation does not
            // split into separate file
            if (level < 4)
            {
                sectionTitle.IsFloating = true;
            }

            return(sectionTitle);
        }
        public override void VisitDocument(Document document)
        {
            _newDocument = new Document
            {
                Title   = document.Title,
                DocType = document.DocType
            };

            foreach (var authorInfo in document.Authors)
            {
                _newDocument.Authors.Add(authorInfo);
            }

            RemoveDocDirectoryAttribute(_newDocument);
            RemoveDocDirectoryAttribute(document);

            foreach (var attributeEntry in document.Attributes)
            {
                _newDocument.Attributes.Add(attributeEntry);
            }

            if (document.Attributes.All(a => a.Name != "ref_current"))
            {
                _newDocument.Attributes.Add(new AttributeEntry("ref_current",
                                                               $"https://www.elastic.co/guide/en/elasticsearch/reference/{Program.DocVersion}"));
            }

            var github = "https://github.com/elastic/elasticsearch-net";

            if (document.Attributes.All(a => a.Name != "github"))
            {
                _newDocument.Attributes.Add(new AttributeEntry("github", github));
            }

            if (document.Attributes.All(a => a.Name != "nuget"))
            {
                _newDocument.Attributes.Add(new AttributeEntry("nuget", "https://www.nuget.org/packages"));
            }

            var originalFile = Regex.Replace(_source.FullName.Replace("\\", "/"), @"^(.*Tests/)",
                                             $"{github}/tree/{Program.BranchName}/src/Tests/");

            _newDocument.Insert(0, new Comment
            {
                Style = CommentStyle.MultiLine,
                Text  = $"IMPORTANT NOTE\r\n==============\r\nThis file has been generated from {originalFile}. \r\n" +
                        "If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,\r\n" +
                        "please modify the original csharp file found at the link and submit the PR with that change. Thanks!"
            });

            _topSectionTitleLevel = _source.Directory.Name.Equals("request", StringComparison.OrdinalIgnoreCase) &&
                                    _source.Directory.Parent != null &&
                                    _source.Directory.Parent.Name.Equals("search", StringComparison.OrdinalIgnoreCase)
                                ? 2
                                : 3;

            // see if the document has some kind of top level title and add one with an anchor if not.
            // Used to add titles to *Usage test files
            if (document.Title == null && document.Count > 0)
            {
                var sectionTitle = document[0] as SectionTitle;

                // capture existing top level
                if (sectionTitle != null && sectionTitle.Level <= 3)
                {
                    _topSectionTitleLevel = sectionTitle.Level;
                }

                if (sectionTitle == null || (sectionTitle.Level > 3))
                {
                    var id    = Path.GetFileNameWithoutExtension(_destination.Name);
                    var title = id.LowercaseHyphenToPascal();
                    sectionTitle = new SectionTitle(title, _topSectionTitleLevel);
                    sectionTitle.Attributes.Add(new Anchor(id));
                    _newDocument.Add(sectionTitle);
                }
            }

            base.VisitDocument(document);
        }
Пример #11
0
		public override void Visit(SectionTitle sectionTitle)
		{
			if (sectionTitle.Level != 2)
			{
				base.Visit(sectionTitle);
				return;
			}

			// Generate an anchor for all Level 2 section titles
			if (!sectionTitle.Attributes.HasAnchor)
			{
				var builder = new StringBuilder();
				using (var writer = new AsciiDocVisitor(new StringWriter(builder)))
				{
					writer.Visit(sectionTitle.Elements);
				}

				var title = builder.ToString().PascalToHyphen();
				sectionTitle.Attributes.Add(new Anchor(title));
			}

			// Check for duplicate ids across documents
			var key = sectionTitle.Attributes.Anchor.Id;
			string existingFile;
			if (Ids.TryGetValue(key, out existingFile))
			{
				throw new Exception($"duplicate id {key} in {_destination.FullName}. Id already exists in {existingFile}");
			}

			Ids.Add(key, _destination.FullName);
			base.Visit(sectionTitle);
		}
Пример #12
0
        void ReleaseDesignerOutlets()
        {
            if (LoadingSpinner != null)
            {
                LoadingSpinner.Dispose();
                LoadingSpinner = null;
            }

            if (LoadingErrorImg != null)
            {
                LoadingErrorImg.Dispose();
                LoadingErrorImg = null;
            }

            if (LoadingText != null)
            {
                LoadingText.Dispose();
                LoadingText = null;
            }

            if (ReleasesNavSearchLoadingSpinner != null)
            {
                ReleasesNavSearchLoadingSpinner.Dispose();
                ReleasesNavSearchLoadingSpinner = null;
            }

            if (ReleasesNavCloseSearchBtn != null)
            {
                ReleasesNavCloseSearchBtn.Dispose();
                ReleasesNavCloseSearchBtn = null;
            }

            if (ReleasesNavSplitterLbl != null)
            {
                ReleasesNavSplitterLbl.Dispose();
                ReleasesNavSplitterLbl = null;
            }

            if (ReleasesSearchBtn != null)
            {
                ReleasesSearchBtn.Dispose();
                ReleasesSearchBtn = null;
            }

            if (ReleasesSearchBar != null)
            {
                ReleasesSearchBar.Dispose();
                ReleasesSearchBar = null;
            }

            if (ReleasesInStoresBtn != null)
            {
                ReleasesInStoresBtn.Dispose();
                ReleasesInStoresBtn = null;
            }

            if (ReleasesUpcomingBtn != null)
            {
                ReleasesUpcomingBtn.Dispose();
                ReleasesUpcomingBtn = null;
            }

            if (SectionHeader != null)
            {
                SectionHeader.Dispose();
                SectionHeader = null;
            }

            if (SectionTitle != null)
            {
                SectionTitle.Dispose();
                SectionTitle = null;
            }

            if (LoadingView != null)
            {
                LoadingView.Dispose();
                LoadingView = null;
            }
        }
		public override void Visit(Document document)
		{
			_newDocument = new Document
			{
				Title = document.Title,
				DocType = document.DocType
			};

			foreach (var authorInfo in document.Authors)
			{
				_newDocument.Authors.Add(authorInfo);
			}

			RemoveDocDirectoryAttribute(_newDocument);
			RemoveDocDirectoryAttribute(document);

			foreach (var attributeEntry in document.Attributes)
			{
				_newDocument.Attributes.Add(attributeEntry);
			}

			if (document.Attributes.All(a => a.Name != "ref_current"))
			{
				_newDocument.Attributes.Add(new AttributeEntry("ref_current", "https://www.elastic.co/guide/en/elasticsearch/reference/master"));
			}

			var github = "https://github.com/elastic/elasticsearch-net";
			if (document.Attributes.All(a => a.Name != "github"))
			{
				_newDocument.Attributes.Add(new AttributeEntry("github", github));
			}

			if (document.Attributes.All(a => a.Name != "nuget"))
			{
				_newDocument.Attributes.Add(new AttributeEntry("nuget", "https://www.nuget.org/packages"));
			}

			var originalFile = Regex.Replace(_source.FullName.Replace("\\", "/"), @"^(.*Tests/)", $"{github}/tree/master/src/Tests/");
			_newDocument.Insert(0, new Comment
			{
				Style = CommentStyle.MultiLine,
				Text = $"IMPORTANT NOTE\r\n==============\r\nThis file has been generated from {originalFile}. \r\n" +
					   "If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,\r\n" +
					   "please modify the original csharp file found at the link and submit the PR with that change. Thanks!"
			});

			// see if the document has some kind of top level title and add one with an anchor if not.
			if (document.Title == null && document.Count > 0)
			{
				var sectionTitle = document[0] as SectionTitle;

				if (sectionTitle == null || sectionTitle.Level != 2)
				{
					var id = Path.GetFileNameWithoutExtension(_destination.Name);
					var title = id.LowercaseHyphenToPascal();
					sectionTitle = new SectionTitle(title, 2);
					sectionTitle.Attributes.Add(new Anchor(id));

					_newDocument.Add(sectionTitle);
				}
			}

			base.Visit(document);
		}
Пример #14
0
        void UpdateDetails()
        {
            Title = string.Format("{0} to {1} on {2}", Flight.AirportDeparted,
                                  Flight.AirportArrived, Flight.Date.ToShortDateString());

            List <List <FlightProperty> > newSections = new List <List <FlightProperty> > ();
            List <SectionTitle>           newTitles   = new List <SectionTitle> ();

            // Create a new list of sections & properties
            for (int i = 0; i < PropertySections.Count; i++)
            {
                List <FlightProperty> section = null;

                foreach (var property in PropertySections[i])
                {
                    if (Flight.ToString(property) != null)
                    {
                        if (section == null)
                        {
                            section = new List <FlightProperty> ();
                        }
                        section.Add(property);
                    }
                }

                if (section != null)
                {
                    newTitles.Add((SectionTitle)i);
                    newSections.Add(section);
                }
            }

#if ATTEMPT_TO_DO_FANCY_ANIMATIONS
            // Update sections & titles to match newSections and newTitles
            List <NSIndexPath> reload = new List <NSIndexPath> ();
            bool needEndUpdates       = false;
            bool reloadRemarks        = false;

            // Remove old rows and sections...
            for (int section = PropertySections.Count - 1; section >= 0; section--)
            {
                SectionTitle title      = (SectionTitle)section;
                int          oldSection = titles.IndexOf(title);

                if (oldSection == -1)
                {
                    continue;
                }

                int newSection = newTitles.IndexOf(title);
                if (newSection != -1 && title != SectionTitle.Remarks)
                {
                    // Remove old rows...
                    List <NSIndexPath> rows = new List <NSIndexPath> ();

                    for (int row = PropertySections[section].Count - 1; row >= 0; row--)
                    {
                        var property = PropertySections[section][row];
                        int oldRow   = sections[oldSection].IndexOf(property);

                        if (oldRow == -1)
                        {
                            continue;
                        }

                        int newRow = newSections[newSection].IndexOf(property);
                        if (newRow != -1)
                        {
                            continue;
                        }

                        //Console.WriteLine ("Removing {0} (row = {1}) from {2} (section = {3})", property, oldRow, title, oldSection);
                        rows.Add(NSIndexPath.FromRowSection(oldRow, oldSection));
                        sections[oldSection].RemoveAt(oldRow);
                    }

                    if (rows.Count > 0)
                    {
                        if (!needEndUpdates)
                        {
                            TableView.BeginUpdates();
                            needEndUpdates = true;
                        }

                        TableView.DeleteRows(rows.ToArray(), UITableViewRowAnimation.Automatic);
                        foreach (var row in rows)
                        {
                            row.Dispose();
                        }
                    }
                }
                else if (newSection == -1)
                {
                    // Remove the entire section...
                    //Console.WriteLine ("Removing {0} @ {1}", title, oldSection);
                    if (!needEndUpdates)
                    {
                        TableView.BeginUpdates();
                        needEndUpdates = true;
                    }

                    var idx = NSIndexSet.FromIndex(oldSection);
                    TableView.DeleteSections(idx, UITableViewRowAnimation.Automatic);
                    sections.RemoveAt(oldSection);
                    titles.RemoveAt(oldSection);
                    idx.Dispose();
                }
            }

            // Add new rows and sections while maintaining a list of rows which need to be reloaded
            for (int section = 0; section < PropertySections.Count; section++)
            {
                SectionTitle title      = (SectionTitle)section;
                int          newSection = newTitles.IndexOf(title);

                if (newSection == -1)
                {
                    continue;
                }

                int oldSection = titles.IndexOf(title);
                if (oldSection != -1 && title != SectionTitle.Remarks)
                {
                    // Add new rows...
                    List <NSIndexPath> rows = new List <NSIndexPath> ();

                    for (int row = 0; row < PropertySections[section].Count; row++)
                    {
                        var property = PropertySections[section][row];
                        int newRow   = newSections[newSection].IndexOf(property);

                        if (newRow == -1)
                        {
                            continue;
                        }

                        int oldRow = sections[oldSection].IndexOf(property);
                        if (oldRow != -1)
                        {
                            reload.Add(NSIndexPath.FromRowSection(newRow, newSection));
                            continue;
                        }

                        //Console.WriteLine ("Inserting {0} (row = {1}) into {2} (section = {3})", property, newRow, title, oldSection);
                        rows.Add(NSIndexPath.FromRowSection(newRow, oldSection));
                        sections[oldSection].Insert(newRow, property);
                    }

                    if (rows.Count > 0)
                    {
                        if (!needEndUpdates)
                        {
                            TableView.BeginUpdates();
                            needEndUpdates = true;
                        }

                        TableView.InsertRows(rows.ToArray(), UITableViewRowAnimation.Automatic);
                        foreach (var row in rows)
                        {
                            row.Dispose();
                        }
                    }
                }
                else if (oldSection == -1)
                {
                    // Add the entire section...
                    if (!needEndUpdates)
                    {
                        TableView.BeginUpdates();
                        needEndUpdates = true;
                    }

                    //Console.WriteLine ("Inserting {0} @ {1}", title, newSection);
                    var idx = NSIndexSet.FromIndex(newSection);
                    TableView.InsertSections(idx, UITableViewRowAnimation.Automatic);
                    sections.Insert(newSection, newSections[newSection]);
                    titles.Insert(newSection, title);
                    idx.Dispose();
                }
                else if (title == SectionTitle.Remarks)
                {
                    reloadRemarks = true;
                }
            }

            if (needEndUpdates)
            {
                TableView.EndUpdates();
            }

            if (reload.Count > 0)
            {
                TableView.ReloadRows(reload.ToArray(), UITableViewRowAnimation.None);
                foreach (var row in reload)
                {
                    row.Dispose();
                }
            }

            if (reloadRemarks)
            {
                var remarks = NSIndexSet.FromIndex(sections.Count - 1);
                TableView.ReloadSections(remarks, UITableViewRowAnimation.None);
                remarks.Dispose();
            }
#else
            sections = newSections;
            titles   = newTitles;

            TableView.ReloadData();
#endif
        }
Пример #15
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     SectionTitle = SectionTitle.TitleBlock;
 }