Example #1
0
            /// <summary>
            ///
            /// </summary>
            /// <returns>A list of the JS citation objects.</returns>
            object[] Reset()
            {
                citationList.Clear();
                bibliographyWordFields.Clear();

                var result = new List <object>();

                foreach (var cslField in documentController.EnumerateCSLFields())
                {
                    if (IsBibliographyField(cslField))
                    {
                        bibliographyWordFields.Add(cslField);
                        continue;
                    }

                    if (!IsCitationField(cslField))
                    {
                        continue;
                    }

                    var existingCitation = GetCitation(cslField.Code.Text);

                    result.Add(existingCitation.JSObject);

                    var citationIDAndIndexPair = new JSCitationIDAndIndexPair
                    {
                        ID          = (string)existingCitation.CitationID,
                        FieldSource = cslField
                    };

                    citationList.Add(citationIDAndIndexPair);

                    for (var i = 0; i < existingCitation.CitationItems.Length; i++)
                    {
                        citeProc.CacheRawCitationItem(existingCitation.CitationItems[i].ItemData);
                    }
                }

                return(result.ToArray());
            }
Example #2
0
		public object HackCreateWrappedArray(JSCitationIDAndIndexPair[] objects)
		{
			var jsVersion = new object[objects.Length];
			for(var i = 0; i < jsVersion.Length; i++)
			{
				jsVersion[i] = CreateJSArray(new object[] { objects[i].ID, objects[i].Index });
			}

			var result = CreateJSArray(jsVersion);
			return result;
		}
			/// <summary>
			/// 
			/// </summary>
			/// <returns>A list of the JS citation objects.</returns>
			object[] Reset()
			{
				citationList.Clear();
				bibliographyWordFields.Clear();

				var result = new List<object>();

				foreach (var cslField in documentController.EnumerateCSLFields())
				{
					if (IsBibliographyField(cslField))
					{
						bibliographyWordFields.Add(cslField);
						continue;
					}

					if (!IsCitationField(cslField)) continue;

					var existingCitation = GetCitation(cslField.Code.Text);

					result.Add(existingCitation.JSObject);

					var citationIDAndIndexPair = new JSCitationIDAndIndexPair
					                            	{
					                            		ID = (string) existingCitation.CitationID,
					                            		FieldSource = cslField
					                            	};

					citationList.Add(citationIDAndIndexPair);

					for (var i = 0; i < existingCitation.CitationItems.Length; i++)
					{
						citeProc.CacheRawCitationItem(existingCitation.CitationItems[i].ItemData);
					}
				}

				return result.ToArray();
			}