Exemplo n.º 1
0
 private void Open_Click(object sender, RoutedEventArgs e)
 {
     if (RequestOpen != null)
     {
         RequestOpen.Invoke();
     }
 }
Exemplo n.º 2
0
        public String Open(String filename)
        {
            log.Debug(DateTime.Now.Ticks + " Open: " + filename);


            Console.WriteLine("#OPEN  Open: " + filename);
            //            if (GetFileMetadataEntry(filename) != null)
            //              throw new PadiException(PadiExceptiontType.OpenFile, "ClientCore: File already opened: " + filename);

            RequestOpen openRequest = new RequestOpen(filename);

            log.Debug(DateTime.Now.Ticks + " [M] Send Open: " + filename);
            MetaserverResponse response  = MetaserverClient.SendRequestToMetaserver(openRequest);
            MetadataEntry      metaEntry = response.MetaEntry;

            if (metaEntry == null)
            {
                throw new PadiException(PadiExceptiontType.OpenFile, "Response without entry");
            }

            if (GetFileMetadataEntry(filename) != null)
            {
                UpdateMetadataEntry(metaEntry);
                Console.WriteLine("#Open: Value Updated");
                log.Debug(DateTime.Now.Ticks + " Open Done: " + filename);
                return(metaEntry.ToString());
            }

            AddFileMetadataEntry(metaEntry);
            log.Debug(DateTime.Now.Ticks + " Open done: " + filename);
            Console.WriteLine("#Open: Complete");
            return(metaEntry.ToString());
        }
Exemplo n.º 3
0
        private static MetaserverResponse Open(MetaRequest request)
        {
            RequestOpen        openRequest = (RequestOpen)request;
            MetaserverResponse response;

            try
            {
                MetadataEntry entry = core.Open(openRequest.FileName, request.ClientId);
                response           = new MetaserverResponse(ResponseStatus.Success, request, ThisMetaserverId);
                response.MetaEntry = entry;
            }
            catch (Exception ex)
            {
                response           = new MetaserverResponse(ResponseStatus.Exception, request, ThisMetaserverId);
                response.Exception = new PadiException(PadiExceptiontType.OpenFile, ex.Message);
            }
            return(response);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Fires the <see cref="RequestOpen"/> event.
 /// </summary>
 public void Clicked()
 {
     RequestOpen?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 5
0
 public SQLLoader(RequestOpen connectionString)
 {
     _connectionString = connectionString.GetCommand();
 }
Exemplo n.º 6
0
 public RequestParser(RequestOpen request)
 {
     _loader = new SQLLoader(request);
 }