コード例 #1
0
        /// <summary>
        /// Create a new reference.
        /// </summary>
        /// <param name="reference">New reference.</param>
        public static void CreateReference(Reference reference)
        {
            WebReference webReference = new WebReference();

            // Check arguments.
            reference.CheckNotNull("reference");

            webReference.Id = 0;
#if DATA_SPECIFIED_EXISTS
            webReference.IdSpecified = true;
#endif
            webReference.Name = reference.Name;
            webReference.Year = reference.Year;
#if DATA_SPECIFIED_EXISTS
            webReference.YearSpecified = true;
#endif
            webReference.Text = reference.Text;

            WebServiceClient.CreateReference(webReference);

            //Make sure that we load new references when we reach LoadReferences
            References = null;
        }