Пример #1
0
 /// <summary>
 /// 获取单例对象
 /// </summary>
 /// <returns></returns>
 public static ProductSet getInstance()
 {
     if (instance == null)
     {
         lock (typeof(ProductSet))
         {
             if (instance == null)
             {
                 instance = new ProductSet();
             }
         }
     }
     return(instance);
 }
Пример #2
0
        public int load(string path, ref string exMessage)
        {
            int result = 0;

            try
            {
                using (Stream fStream = File.OpenRead(path))
                {
                    System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(ProductSet));
                    instance = serializer.Deserialize(fStream) as ProductSet;
                }
            }
            catch (System.Exception ex)
            {
                SoftwareInfo.getInstance().WriteLog("load:\n" + ex.ToString());
                exMessage = ex.Message;
                result    = 1;
            }
            return(result);
        }
Пример #3
0
 public ROI()
 {
     Height = ProductSet.getInstance().ROIHeight;
     Width  = ProductSet.getInstance().ROIWidth;
 }