Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Commands" /> class.
        /// </summary>
        public Commands()
        {
            try
            {
                using (var commands = new DatabaseCommands())
                {
                    #region Initialize Fields

                    _ListofDrawings = new List <string>();
                    usedDrawings    = new List <string>();

                    #endregion

                    #region Linq Select SportVision DWGS

                    var dwgs = commands.GetAllExportToCadRecords();

                    var svdwg = from d in dwgs
                                where d.CompletePath.Contains("SportVision")
                                select d;

                    #endregion

                    #region Set Global Fields

                    _time = svdwg.Select(p => p.DateStamp.Value).FirstOrDefault();

                    _drawingName = svdwg.Select(p => p.CompletePath).FirstOrDefault();

                    _directory = Path.GetDirectoryName(_drawingName);

                    _ListofDrawings = svdwg.Select(p => p.CompletePath).ToList();

                    #endregion

                    #region Initialize Classes and Objects

                    breaklines       = new Breaklines(_time, _ListofDrawings);
                    selectPolylines  = new SelectPolylines();
                    usedFeatureLines = new ObjectIdCollection();
                    used3dCollection = new ObjectIdCollection();
                    usedDrawings     = new List <string>();

                    #endregion
                }
            }
            catch (Exception)
            {
                MessengerManager.MessengerManager.AddLog
                    ("Initialize Open Drawing for Processing!");
            }
        }
Esempio n. 2
0
        public Commands(DateTime value, string outdwg)
        {
            _time        = value;
            _drawingName = outdwg;

            try
            {
                using (DatabaseCommands commands = new DatabaseCommands())
                {
                    #region Initialize Fields

                    _ListofDrawings = new List <string>();
                    #endregion

                    #region Set Global Fields

                    _directory = Path.GetDirectoryName(_drawingName);

                    _ListofDrawings.Add(outdwg);

                    #endregion

                    #region Initialize Classes and Objects

                    breaklines       = new Breaklines(_time, _ListofDrawings);
                    selectPolylines  = new SelectPolylines();
                    usedFeatureLines = new ObjectIdCollection();
                    used3dCollection = new ObjectIdCollection();
                    usedDrawings     = new List <string>();

                    #endregion
                }
            }
            catch (System.Exception)
            {
                PGA.MessengerManager.MessengerManager.AddLog
                    ("Initialize Open Drawing for Processing!");
            }
        }