Exemplo n.º 1
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method resets the data.</summary>
        ///--------------------------------------------------------------------------------
        protected override void OnReset()
        {
            EditXmlSource.TransformDataFromObject(XmlSource, null, false);
            ResetItems();

            #region protected
            #endregion protected

            EditXmlSource.ResetModified(false);
        }
Exemplo n.º 2
0
 ///--------------------------------------------------------------------------------
 /// <summary>This method sets the default values.</summary>
 ///--------------------------------------------------------------------------------
 protected override void OnSetDefaults()
 {
     if (XmlSource.ReverseInstance != null)
     {
         EditXmlSource.TransformDataFromObject(XmlSource.ReverseInstance, null, false);
     }
     else if (XmlSource.IsAutoUpdated == true)
     {
         EditXmlSource.TransformDataFromObject(XmlSource, null, false);
     }
     else
     {
         XmlSource newXmlSource = new XmlSource();
         newXmlSource.SpecificationSourceID = EditXmlSource.SpecificationSourceID;
         EditXmlSource.TransformDataFromObject(newXmlSource, null, false);
     }
     EditXmlSource.ResetModified(true);
 }
Exemplo n.º 3
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method updates the view model data and sends update command back
        /// to the solution builder.</summary>
        ///--------------------------------------------------------------------------------
        protected override void OnUpdate()
        {
            // set up reverse engineering instance if not present
            if (XmlSource.ReverseInstance == null && XmlSource.IsAutoUpdated == true)
            {
                XmlSource.ReverseInstance = new XmlSource();
                XmlSource.ReverseInstance.TransformDataFromObject(XmlSource, null, false);

                // perform the update of EditXmlSource back to XmlSource
                XmlSource.TransformDataFromObject(EditXmlSource, null, false);
                XmlSource.IsAutoUpdated = false;
            }
            else if (XmlSource.ReverseInstance != null)
            {
                EditXmlSource.ResetModified(XmlSource.ReverseInstance.IsModified);
                if (EditXmlSource.Equals(XmlSource.ReverseInstance))
                {
                    // perform the update of EditXmlSource back to XmlSource
                    XmlSource.TransformDataFromObject(EditXmlSource, null, false);
                    XmlSource.IsAutoUpdated = true;
                }
                else
                {
                    // perform the update of EditXmlSource back to XmlSource
                    XmlSource.TransformDataFromObject(EditXmlSource, null, false);
                    XmlSource.IsAutoUpdated = false;
                }
            }
            else
            {
                // perform the update of EditXmlSource back to XmlSource
                XmlSource.TransformDataFromObject(EditXmlSource, null, false);
                XmlSource.IsAutoUpdated = false;
            }
            XmlSource.ForwardInstance = null;
            if (SourceFileNameCustomized || SourceFilePathCustomized || TemplatePathCustomized || OrderCustomized || DescriptionCustomized || TagsCustomized)
            {
                XmlSource.ForwardInstance = new XmlSource();
                XmlSource.ForwardInstance.SpecificationSourceID = EditXmlSource.SpecificationSourceID;
                XmlSource.SpecSourceName = XmlSource.DefaultSourceName;
                if (SourceFileNameCustomized)
                {
                    XmlSource.ForwardInstance.SourceFileName = EditXmlSource.SourceFileName;
                }
                if (SourceFilePathCustomized)
                {
                    XmlSource.ForwardInstance.SourceFilePath = EditXmlSource.SourceFilePath;
                }
                if (TemplatePathCustomized)
                {
                    XmlSource.ForwardInstance.TemplatePath = EditXmlSource.TemplatePath;
                }
                if (OrderCustomized)
                {
                    XmlSource.ForwardInstance.Order = EditXmlSource.Order;
                }
                if (DescriptionCustomized)
                {
                    XmlSource.ForwardInstance.Description = EditXmlSource.Description;
                }
                if (TagsCustomized)
                {
                    XmlSource.ForwardInstance.Tags = EditXmlSource.Tags;
                }
            }
            EditXmlSource.ResetModified(false);
            OnUpdated(this, null);

            // send update back to solution builder
            SendEditXmlSourcePerformed();
        }