public Record Create(string a, string b, DateTime c, DateTime d,
                      RecordStatus e, DateTime f, int g, int h, string i)
 {
     return(new Record()
     {
     });
 }
Пример #2
0
 internal List <Records> GetRecords(RecordStatus status)
 {
     lock (_records)
     {
         return(_records.Where(records => records.Status == status).ToList());
     }
 }
Пример #3
0
 public Poll(int id)
 {
     this.id  = id;
     date     = DateTime.Now;
     question = "";
     status   = RecordStatus.New;
 }
Пример #4
0
 public StatusChanged(Guid id, Guid userId, Guid fileId, RecordStatus status)
 {
     Id     = id;
     UserId = userId;
     FileId = fileId;
     Status = status;
 }
Пример #5
0
 public Poll(GmDataReader dr)
 {
     id       = dr.GetInt();
     date     = dr.GetDateTime();
     question = dr.GetString();
     status   = (RecordStatus)dr.GetInt();
 }
Пример #6
0
 public override void FromTableObject(TableDMS obj)
 {
     Id           = obj.dms_id;
     Guid         = obj.dms_guid;
     ProjectId    = obj.project_id;
     RecordStatus = (RecordStatus)obj.record_status_id;
 }
Пример #7
0
 /// <summary>
 /// Method To Clear All Record
 /// </summary>
 public void ClearAll()
 {
     try
     {
         FirstName = string.Empty;
         LastName  = string.Empty;
         UserCode  = string.Empty;
         RoleList.Clear();
         GetAllRoles(0);
         RecordStatus.Clear();
         GetRecordStatus();
     }
     catch (Exception ex)
     {
         LogHelper.LogErrorToDb(ex);
         bool displayErrorOnUI = false;
         CommonSettings.logger.LogError(this.GetType(), ex);
         if (displayErrorOnUI)
         {
             throw;
         }
     }
     finally
     {
         CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     }
 }
Пример #8
0
        public void SetStatus(string fetchXML, RecordStatus recordStatus)
        {
            if (string.IsNullOrWhiteSpace(fetchXML))
            {
                return;
            }
            var records = GetRecords(OrganizationService, fetchXML);

            if (records.Entities.Count == 0)
            {
                Logger?.Invoke(this, $"Warning - No records that can be disabled found for the FetchXML supplied");
                return;
            }

            foreach (var entity in records.Entities)
            {
                if (stateChanged(entity, recordStatus))
                {
                    SetRecordStatus(OrganizationService, entity, recordStatus);
                    Logger?.Invoke(this, $"Record '{entity.LogicalName} {entity.Id}' set to {recordStatus}");
                }
                else
                {
                    Logger?.Invoke(this, $"Record '{entity.LogicalName} {entity.Id}' already in the {recordStatus} state");
                }
            }
        }
Пример #9
0
 internal List<Records> GetRecords(RecordStatus status)
 {
     lock (_records)
     {
         return _records.Where(records => records.Status == status).ToList();
     }
 }
 public void Clear()
 {
     Status.Clear();
     RecordStatus.Clear();
     Employer.Clear();
     Course.Clear();
     FundingStatus.Clear();
 }
Пример #11
0
 public SubRecord(DateTime time, RecordStatus status, string folder, string name, long size)
 {
     Time   = time;
     Status = status;
     Folder = folder;
     Name   = name;
     Size   = size;
 }
Пример #12
0
 public PollAnswer(GmDataReader dr)
 {
     id     = dr.GetInt();
     pollId = dr.GetInt();
     answer = dr.GetString();
     count  = dr.GetInt();
     status = (RecordStatus)dr.GetInt();
 }
Пример #13
0
 public PollAnswer(int id)
 {
     this.id = id;
     pollId  = 0;
     answer  = "";
     count   = 0;
     status  = RecordStatus.New;
 }
Пример #14
0
 public ArticleParam(int articleId)
 {
     id             = 0;
     this.articleId = articleId;
     key            = "";
     value          = "";
     status         = RecordStatus.New;
 }
Пример #15
0
 public void RefreshRecordStatus(int idx, RecordStatus status)
 {
     if (idx >= recordItems.Length || idx < 0)
     {
         return;
     }
     recordItems[idx].Refresh(status);
 }
Пример #16
0
 public ArticleParam()
 {
     id        = 0;
     articleId = 0;
     key       = "";
     value     = "";
     status    = RecordStatus.New;
 }
Пример #17
0
 public void InitFromUpdate(EO2ODeliveryAddr updateObj)
 {
     this.Name         = updateObj.Name;
     this.Code         = updateObj.Code;
     this.City         = updateObj.City;
     this.Address      = updateObj.Address;
     this.RecordStatus = updateObj.RecordStatus;
 }
Пример #18
0
        public void Start()
        {
            Status = RecordStatus.Running;

            timer.Start();

            rideRecorder.StartRide(ShouldDetectJumps);
        }
Пример #19
0
 public ArticleParam(GmDataReader dr)
 {
     id        = dr.GetInt();
     articleId = dr.GetInt();
     key       = dr.GetString();
     value     = dr.GetString();
     status    = (RecordStatus)dr.GetInt();
 }
Пример #20
0
 /// <summary>
 /// New a state machine of record to send alert message.
 /// </summary>
 /// <param name="upper">High vlaue for alert.</param>
 /// <param name="down">Low value for alert.</param>
 /// <param name="flunt">Fluntuating value for alert.</param>
 public ThermoRecord(float upper, float down, float flunt)
 {
     upperTrigger  = upper;
     downerTriggrt = down;
     flunctuating  = flunt;
     status        = RecordStatus.Init;
     iMyAlert      = new ThemoAlert();
 }
        public static async Task <IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequestMessage req,
                                                     ILogger log,
                                                     [Inject] ICourseService coursesService)
        {
            var qryUKPRN = req.RequestUri.ParseQueryString()["UKPRN"]?.ToString()
                           ?? (await(dynamic) req.Content.ReadAsAsync <object>())?.UKPRN;
            var qryStatusToBeChangedTo = req.RequestUri.ParseQueryString()["StatusToBeChangedTo"]?.ToString()
                                         ?? (await(dynamic) req.Content.ReadAsAsync <object>())?.StatusToBeChangedTo;

            if (string.IsNullOrWhiteSpace(qryUKPRN))
            {
                return(new BadRequestObjectResult($"Empty or missing UKPRN value."));
            }

            if (!int.TryParse(qryUKPRN, out int UKPRN))
            {
                return(new BadRequestObjectResult($"Invalid UKPRN value, expected a valid integer"));
            }


            if (string.IsNullOrWhiteSpace(qryStatusToBeChangedTo))
            {
                return(new BadRequestObjectResult($"Empty or missing StatusToBeChangedTo value."));
            }

            if (!int.TryParse(qryStatusToBeChangedTo, out int intStatusToBeChangedTo))
            {
                return(new BadRequestObjectResult($"Invalid StatusToBeChangedTo value, expected a valid integer"));
            }

            RecordStatus StatusToBeChangedTo = RecordStatus.Undefined;

            if (Enum.IsDefined(typeof(RecordStatus), intStatusToBeChangedTo))
            {
                StatusToBeChangedTo = (RecordStatus)Enum.ToObject(typeof(RecordStatus), intStatusToBeChangedTo);
            }
            else
            {
                return(new BadRequestObjectResult($"StatusToBeChangedTo value cannot be parse into valid RecordStatus"));
            }

            if (StatusToBeChangedTo.Equals(RecordStatus.Undefined))
            {
                return(new BadRequestObjectResult($"StatusToBeChangedTo value is not allowed to be with  Undefined RecordStatus"));
            }


            try
            {
                var returnCode = await coursesService.ArchiveCoursesExceptBulkUploadReadytoGoLive(UKPRN, StatusToBeChangedTo);

                return(new OkObjectResult(returnCode));
            }
            catch (Exception e)
            {
                return(new InternalServerErrorObjectResult(e));
            }
        }
Пример #22
0
 public GalleryImage(GmDataReader dr)
 {
     id        = dr.GetInt32();
     galleryId = dr.GetInt32();
     filename  = dr.GetString();
     name      = dr.GetString();
     text      = dr.GetString();
     status    = (RecordStatus)dr.GetInt32();
 }
Пример #23
0
 public Gallery(int id)
 {
     this.id     = id;
     communityId = 0;
     name        = "";
     text        = "";
     status      = RecordStatus.New;
     logo        = "";
 }
Пример #24
0
 public ForumTopic(int id)
 {
     this.id     = id;
     forumId     = 0;
     date        = DateTime.Now;
     name        = "";
     description = "";
     status      = RecordStatus.New;
 }
Пример #25
0
 public ForumTopic(GmDataReader dr)
 {
     id          = dr.GetInt();
     forumId     = dr.GetInt();
     date        = dr.GetDateTime();
     name        = dr.GetString();
     description = dr.GetString();
     status      = (RecordStatus)dr.GetInt();
 }
Пример #26
0
 public GalleryImage(int id)
 {
     this.id   = id;
     galleryId = 0;
     filename  = "";
     name      = "";
     text      = "";
     status    = RecordStatus.New;
 }
Пример #27
0
 public Gallery(GmDataReader dr)
 {
     id          = dr.GetInt();
     communityId = dr.GetInt();
     name        = dr.GetString();
     text        = dr.GetString();
     status      = (RecordStatus)dr.GetInt();
     logo        = dr.GetString();
 }
Пример #28
0
 private void ModuleEditForm_Load(object sender, EventArgs e)
 {
     dataGridView_module.AutoGenerateColumns = false;
     moduledata = ModulesOperator.LoadModulesInfo();
     dataGridView_module.DataSource = moduledata.Tables[ModuleData.MODULES_TABLE].DefaultView;
     pageStatus = RecordStatus.View;
     SetFormControlerStatus();
     SetFormControlerData();
 }
Пример #29
0
 public Forum(int id)
 {
     this.id     = id;
     communityId = 0;
     date        = DateTime.Now;
     name        = "";
     description = "";
     status      = RecordStatus.New;
 }
Пример #30
0
 public Forum(GmDataReader dr)
 {
     id          = dr.GetInt32();
     communityId = dr.GetInt();
     date        = dr.GetDateTime();
     name        = dr.GetString();
     description = dr.GetString();
     status      = (RecordStatus)dr.GetInt();
 }
Пример #31
0
 public void InitFromUpdate(EO2ORule updateObj)
 {
     this.Name              = updateObj.Name;
     this.Code              = updateObj.Code;
     this.IsGeneralPayQR    = updateObj.IsGeneralPayQR;
     this.IsMoneyImmediate  = updateObj.IsMoneyImmediate;
     this.NeedMallAccount   = updateObj.NeedMallAccount;
     this.NeedMallSMSVerify = updateObj.NeedMallSMSVerify;
     this.RecordStatus      = updateObj.RecordStatus;
 }
Пример #32
0
        public Record Update(int id, string title, string description, RecordStatus status,
            DateTime statusDate, DateTime dateCreated, DateTime? finishingDate, int documentId)
        {
            var record = this.data.Records.GetById(id);

            record.Title = title;
            record.Description = description;
            record.Status = status;
            record.StatusDate = statusDate;
            record.DateCreated = dateCreated;
            record.FinishingDate = finishingDate;
            record.DocumentId = documentId;

            this.data.SaveChanges();
            return record;
        }
Пример #33
0
        public Record Create(string title, string description, DateTime dateCreated, DateTime? finishingDate,
            RecordStatus status, DateTime statusDate, int documentId, int areaId, string fileExtension)
        {
            var record = new Record
            {
                Title = title,
                Description = description,
                AreaId = areaId,
                DateCreated = dateCreated,
                FinishingDate = finishingDate,
                Status = status,
                StatusDate = statusDate,
                DocumentId = documentId
            };

            this.data.Records.Add(record);

            //Create file to record
            var recordFile = new RecordFile
            {
                DateUpdated = DateTime.Now,
                RecordId = record.Id
            };

            this.data.RecordFiles.Add(recordFile);

            record.RecordFiles.Add(recordFile);
            this.data.SaveChanges();

            var filePath = $"~/Files/Records/{recordFile.Id % 1000}/{recordFile.Id}-{DateTime.Now.ToShortDateString()}{fileExtension}";

            recordFile.Path = filePath;
            this.data.SaveChanges();

            return record;
        }
Пример #34
0
 internal void Add(Channel ch, DateTime start, DateTime end, RecordStatus status, string name="")
 {
     Records rec = new Records("http://127.0.0.1:" + _device.Web.Port, _outpath)
     {
         Id = Guid.NewGuid().ToString(),
         
     };
     if (string.IsNullOrEmpty(name))
     {
         if (ch.epg_id > 0 && end < DateTime.Today.AddDays(1).AddTicks(-1))
         {
             var epgs = _device.RecordsProvider.GetListOfEpg(ch.epg_id);
             if (epgs != null && epgs.Count > 0)
             {
                 var epg =
                     epgs.FirstOrDefault(
                         epg1 => epg1.StartTime < start.Add(start - epg1.StartTime) && epg1.EndTime > end);
                 if (epg != null && epg.EndTime.AddMinutes(30) < end)
                 {
                     rec.Name = string.Format("[{0}-{1}] {2} - {3}", start.ToString("dd/MM/yy HH:mm"),
                         end.ToString("dd/MM/yy HH:mm"), ch.name, epg.name);
                 }
             }
         }
         if (string.IsNullOrEmpty(rec.Name))
             rec.Name = string.Format("[{1}-{2}] {0}", ch.name, start.ToString("dd/MM/yy HH:mm"),
                 end.ToString("dd/MM/yy HH:mm"));
     }
     else
         rec.Name = name;
     rec.Start = start;
     rec.End = end;
     rec.Status = status;
     rec.TorrentId = ch.id;
     Add(rec);
 }
 public Record Create(string a, string b, DateTime c, DateTime d,
         RecordStatus e, DateTime f, int g, int h, string i)
 {
     return new Record() { };
 }
Пример #36
0
        private void Button_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
        {
            if (gSpendTime == 0)
            {
                MessageBox.Show("时间太短,重新录音!");
            }
            Stop();
            timer.Stop();
            status = RecordStatus.Recorded;
            e.Handled = true;

            Button btn = sender as Button;
            btn.ManipulationCompleted -= Button_ManipulationCompleted;
            gMicrophone.BufferReady -= new EventHandler<EventArgs>(gMicrophone_BufferReady);
        }
Пример #37
0
        private void Button_Hold(object sender, System.Windows.Input.GestureEventArgs e)
        {
            gSpendTime = 0;

            //定期每33毫秒執行一次FrameworkDispatcher.Update(); 方法
            timer.Interval = TimeSpan.FromMilliseconds(33);
            timer.Tick += delegate { try { FrameworkDispatcher.Update(); } catch { } };
            timer.Start();

            gMicrophone.BufferDuration = TimeSpan.FromMilliseconds(1000);
            gAudioBuffer = new byte[gMicrophone.GetSampleSizeInBytes(gMicrophone.BufferDuration)];
            gMicrophone.Start();
            gMicrophone.BufferReady += new EventHandler<EventArgs>(gMicrophone_BufferReady);

            Button btn = sender as Button;
            btn.ManipulationCompleted += Button_ManipulationCompleted;

            Dispatcher.BeginInvoke(() =>
            {
                recordTime.Text = string.Format("{0}\"", gSpendTime.ToString());
            });

            status = RecordStatus.Recording;
        }
Пример #38
0
        internal static List<string> RequestRecordDataUnmapped(SharedNetworkInfo sharedInfo, List<string> missingRecordData)
        {
            HashSet<string> successes = new HashSet<string>();
            int index = 0;
            List<string> returnedRecords = new List<string>();
            HashSet<string> recordDataIdentifiers = new HashSet<string>();
            List<string> dependentData = new List<string>();
            if (sharedInfo.Client)
                Printer.PrintMessage("Requesting #b#{0}## records from remote...", missingRecordData.Count);
            while (index < missingRecordData.Count)
            {
                RequestRecordDataUnmapped rrd = new RequestRecordDataUnmapped();
                List<string> recordsInPack = new List<string>();
                while (recordsInPack.Count < 1024 * 32 && index < missingRecordData.Count)
                {
                    var data = missingRecordData[index++];
                    if (!recordDataIdentifiers.Contains(data))
                    {
                        recordDataIdentifiers.Add(data);
                        recordsInPack.Add(data);
                    }
                }
                if (recordsInPack.Count > 0)
                {
                    rrd.RecordDataKeys = recordsInPack.ToArray();
                    ProtoBuf.Serializer.SerializeWithLengthPrefix<NetCommand>(sharedInfo.Stream, new NetCommand() { Type = NetCommandType.RequestRecordUnmapped }, ProtoBuf.PrefixStyle.Fixed32);
                    Utilities.SendEncrypted<RequestRecordDataUnmapped>(sharedInfo, rrd);

                    RecordStatus status = new RecordStatus();
                    var receiverStream = new Versionr.Utilities.ChunkedReceiverStream(() =>
                    {
                        ProtoBuf.Serializer.SerializeWithLengthPrefix<NetCommand>(sharedInfo.Stream, new NetCommand() { Type = NetCommandType.DataReceived }, ProtoBuf.PrefixStyle.Fixed32);
                        var pack = Utilities.ReceiveEncrypted<DataPayload>(sharedInfo);
                        status.Bytes += pack.Data.Length;
                        if (pack.EndOfStream)
                        {
                            return new Tuple<byte[], bool>(pack.Data, true);
                        }
                        else
                        {
                            return new Tuple<byte[], bool>(pack.Data, false);
                        }
                    });

                    status.Stopwatch = new System.Diagnostics.Stopwatch();
                    status.Requested = recordsInPack.Count;
                    Printer.InteractivePrinter printer = null;
                    if (sharedInfo.Client)
                        printer = Printer.CreateProgressBarPrinter("Importing data", string.Empty,
                            (obj) =>
                            {
                                RecordStatus stat = (RecordStatus)obj;
                                return string.Format("{0}/sec", Versionr.Utilities.Misc.FormatSizeFriendly((long)(stat.Bytes / stat.Stopwatch.Elapsed.TotalSeconds)));
                            },
                            (obj) =>
                            {
                                RecordStatus stat = (RecordStatus)obj;
                                return (100.0f * stat.Processed) / (float)stat.Requested;
                            },
                            (pct, obj) =>
                            {
                                RecordStatus stat = (RecordStatus)obj;
                                return string.Format("{0}/{1}", stat.Processed, stat.Requested);
                            },
                            60);
                    
                    status.Stopwatch.Start();
                    var transaction = sharedInfo.Workspace.ObjectStore.BeginStorageTransaction();
                    try
                    {
                        while (!receiverStream.EndOfStream)
                        {
                            byte[] blob = new byte[8];
                            int successFlag;
                            int requestIndex;
                            long recordSize;
                            if (printer != null)
                                printer.Update(status);
                            status.Processed++;
                            if (receiverStream.Read(blob, 0, 8) != 8)
                                continue;
                            requestIndex = BitConverter.ToInt32(blob, 0);
                            successFlag = BitConverter.ToInt32(blob, 4);
                        
                            if (successFlag == 0)
                            {
                                Printer.PrintDiagnostics("Record {0} not located on remote.", recordsInPack[requestIndex]);
                                continue;
                            }

                            receiverStream.Read(blob, 0, 8);
                            recordSize = BitConverter.ToInt64(blob, 0);
                            Printer.PrintDiagnostics("Unpacking record {0}, payload size: {1}", recordsInPack[requestIndex], recordSize);

                            returnedRecords.Add(recordsInPack[requestIndex]);
                            string dependencies;
                            sharedInfo.Workspace.ImportRecordData(transaction, recordsInPack[requestIndex], new Versionr.Utilities.RestrictedStream(receiverStream, recordSize), out dependencies);
                            if (dependencies != null)
                                dependentData.Add(dependencies);

                            if (transaction.PendingRecords > 1024 || transaction.PendingRecordBytes > 256 * 1024 * 1024)
                                sharedInfo.Workspace.ObjectStore.FlushStorageTransaction(transaction);
                        }
                        sharedInfo.Workspace.ObjectStore.EndStorageTransaction(transaction);
                        if (printer != null)
                            printer.End(status);
                    }
                    catch
                    {
                        sharedInfo.Workspace.ObjectStore.AbortStorageTransaction(transaction);
                        throw;
                    }
                    ProtoBuf.Serializer.SerializeWithLengthPrefix<NetCommand>(sharedInfo.Stream, new NetCommand() { Type = NetCommandType.Acknowledge }, ProtoBuf.PrefixStyle.Fixed32);
                }
            }
            List<string> filteredDeps = new List<string>();
            foreach (var x in dependentData)
            {
                if (!recordDataIdentifiers.Contains(x) && !sharedInfo.Workspace.HasObjectDataDirect(x))
                {
                    recordDataIdentifiers.Add(x);
                    filteredDeps.Add(x);
                }
            }
            if (filteredDeps.Count > 0)
                RequestRecordDataUnmapped(sharedInfo, filteredDeps);
            return returnedRecords;
        }
Пример #39
0
        internal static void RequestRecordData(SharedNetworkInfo sharedInfo)
        {
            List<string> dependentData = new List<string>();
            var records = sharedInfo.UnknownRecords;
            int index = 0;
            HashSet<string> recordDataIdentifiers = new HashSet<string>();
            while (index < records.Count)
            {
                RequestRecordData rrd = new RequestRecordData();
                List<long> recordsInPack = new List<long>();
                while (recordsInPack.Count < 1024 * 32 && index < records.Count)
                {
                    long recordIndex = records[index++];
                    var rec = sharedInfo.RemoteRecordMap[recordIndex];
                    if (rec.IsDirectory)
                        continue;
                    if (sharedInfo.Workspace.HasObjectData(rec) || !sharedInfo.Workspace.Included(rec.CanonicalName))
                        continue;
                    if (recordDataIdentifiers.Contains(rec.DataIdentifier))
                        continue;
                    recordDataIdentifiers.Add(rec.DataIdentifier);
                    recordsInPack.Add(recordIndex);
                }
                if (recordsInPack.Count > 0)
                {
                    Printer.PrintDiagnostics("Requesting {0} records.", recordsInPack.Count);
                    rrd.Records = recordsInPack.ToArray();
                    ProtoBuf.Serializer.SerializeWithLengthPrefix<NetCommand>(sharedInfo.Stream, new NetCommand() { Type = NetCommandType.RequestRecord }, ProtoBuf.PrefixStyle.Fixed32);
                    Utilities.SendEncrypted<RequestRecordData>(sharedInfo, rrd);

                    RecordStatus status = new RecordStatus();
                    var receiverStream = new Versionr.Utilities.ChunkedReceiverStream(() =>
                    {
                        ProtoBuf.Serializer.SerializeWithLengthPrefix<NetCommand>(sharedInfo.Stream, new NetCommand() { Type = NetCommandType.DataReceived }, ProtoBuf.PrefixStyle.Fixed32);
                        var pack = Utilities.ReceiveEncrypted<DataPayload>(sharedInfo);
                        status.Bytes += pack.Data.Length;
                        if (pack.EndOfStream)
                        {
                            return new Tuple<byte[], bool>(pack.Data, true);
                        }
                        else
                        {
                            return new Tuple<byte[], bool>(pack.Data, false);
                        }
                    });

                    status.Stopwatch = new System.Diagnostics.Stopwatch();
                    status.Requested = recordsInPack.Count;
                    Printer.InteractivePrinter printer = null;
                    if (sharedInfo.Client)
                        printer = Printer.CreateProgressBarPrinter("Importing data", string.Empty,
                            (obj) =>
                            {
                                RecordStatus stat = (RecordStatus)obj;
                                return string.Format("{0}/sec", Versionr.Utilities.Misc.FormatSizeFriendly((long)(stat.Bytes / stat.Stopwatch.Elapsed.TotalSeconds)));
                            },
                            (obj) =>
                            {
                                RecordStatus stat = (RecordStatus)obj;
                                return (100.0f * stat.Processed) / (float)stat.Requested;
                            },
                            (pct, obj) =>
                            {
                                RecordStatus stat = (RecordStatus)obj;
                                return string.Format("{0}/{1}", stat.Processed, stat.Requested);
                            },
                            60);

                    status.Stopwatch.Start();

                    var transaction = sharedInfo.Workspace.ObjectStore.BeginStorageTransaction();
                    try
                    {
                        while (!receiverStream.EndOfStream)
                        {
                            byte[] blob = new byte[16];
                            long recordIndex;
                            long recordSize;
                            if (receiverStream.Read(blob, 0, 8) != 8)
                                continue;
                            if (printer != null)
                                printer.Update(status);
                            status.Processed++;
                            recordIndex = BitConverter.ToInt64(blob, 0);
                            if (recordIndex < 0)
                            {
                                continue;
                            }
                            receiverStream.Read(blob, 8, 8);
                            recordSize = BitConverter.ToInt64(blob, 8);
                            Printer.PrintDiagnostics("Unpacking remote record {0}, payload size: {1}", recordIndex, recordSize);
                            var rec = sharedInfo.RemoteRecordMap[recordIndex];
                            string dependencies = null;
                            sharedInfo.Workspace.ImportRecordData(transaction, rec.DataIdentifier, new Versionr.Utilities.RestrictedStream(receiverStream, recordSize), out dependencies);
                            if (dependencies != null)
                                dependentData.Add(dependencies);

                            if (transaction.PendingRecords > 8192 || transaction.PendingRecordBytes > 512 * 1024 * 1024)
                                sharedInfo.Workspace.ObjectStore.FlushStorageTransaction(transaction);
                        }
                        sharedInfo.Workspace.ObjectStore.EndStorageTransaction(transaction);
                    }
                    catch
                    {
                        sharedInfo.Workspace.ObjectStore.AbortStorageTransaction(transaction);
                        throw;
                    }
                    if (printer != null)
                        printer.End(status);
                    ProtoBuf.Serializer.SerializeWithLengthPrefix<NetCommand>(sharedInfo.Stream, new NetCommand() { Type = NetCommandType.Acknowledge }, ProtoBuf.PrefixStyle.Fixed32);
                }
            }
            List<string> filteredDeps = new List<string>();
            foreach (var x in dependentData)
            {
                if (!recordDataIdentifiers.Contains(x) && !sharedInfo.Workspace.HasObjectDataDirect(x))
                {
                    recordDataIdentifiers.Add(x);
                    filteredDeps.Add(x);
                }
            }
            if (filteredDeps.Count > 0)
                RequestRecordDataUnmapped(sharedInfo, filteredDeps);
        }
Пример #40
0
        public static string ConvertRecordStatus(RecordStatus status)
        {
            string statusVal = "";

            switch (status)
            {
                case RecordStatus.New:
                    statusVal = "N";
                    break;
                case RecordStatus.Change:
                    statusVal = "C";
                    break;
                case RecordStatus.Teminated:
                    statusVal = "T";
                    break;
                default:
                    statusVal = "";
                    break;
            }

            return statusVal;
        }