Exemplo n.º 1
0
        public void Read()
        {
            //WHY IS THIS NEEDED??
            //int progress = 0;
            Exception ex = null;

            DLReader reader = new DLReader(_Implementation);
            if (_NetworkId == Guid.Empty)
                _NetworkId = Guid.NewGuid();
            reader.NetworkId = _NetworkId;
            reader.Read(_File);

            _netObj = reader.Network;

            if (_netObj == null)
            {
                // set the cancel flag
                IsCancellationPending = true;
                ex = new Exception(string.Format("A network could not be read from {0}:  {1}", _File, reader.Message));
            }
            else
            {
                if (!string.IsNullOrEmpty(_NetworkName))
                    _netObj.Name = _NetworkName;

                //WHY IS THIS NEEDED?
                //progress = 100;
            }
        }
Exemplo n.º 2
0
 public void Reset()
 {
     _netObj = null;
     _File = null;
     _NetworkName = null;
     _Implementation = string.Empty;
     IsCancellationPending = false;
 }