コード例 #1
0
        private void ControlsToData()
        {
            if (specificationListControl.Items.Count == 0)
            {
                _specifications = null;
            }
            else
            {
                if( _specifications == null )
                    _specifications = new Specifications();
                _specifications.Items = new List<object>();
                foreach (ListViewItem lvi in specificationListControl.Items )
                {
                    _specifications.Items.Add(lvi.Tag);
                }

                if (conditionListControl.RowCount == 0 )
                    _specifications.Conditions = null;
                else
                {
                    _specifications.Conditions = conditionListControl.GetColumnValues( 0 ).Cast<string>().ToList();
                }

                if (certificationListControl.RowCount == 0)
                {
                    _specifications.Certifications = null;
                }
                else
                {
                    _specifications.Certifications = certificationListControl.GetColumnValues(0).Cast<string>().ToList();
                }
            }
        }
コード例 #2
0
 public static bool LoadFromFile(string fileName, out Specifications obj)
 {
     Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
コード例 #3
0
 public static bool Deserialize(string input, out Specifications obj)
 {
     Exception exception;
     return Deserialize(input, out obj, out exception);
 }
コード例 #4
0
 /// <summary>
 /// Deserializes xml markup from file into an Specifications object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output Specifications object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out Specifications obj, out Exception exception)
 {
     exception = null;
     obj = default(Specifications);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }
コード例 #5
0
 /// <summary>
 /// Deserializes workflow markup into an Specifications object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output Specifications object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out Specifications obj, out Exception exception)
 {
     exception = null;
     obj = default(Specifications);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (Exception ex)
     {
         exception = ex;
         return false;
     }
 }