Exemplo n.º 1
0
        public async System.Threading.Tasks.Task <RecordDocument> Post(RecordDocument recordDocument)
        {
            // string result = await Request.Content.ReadAsStringAsync();

            string userUPN = await GetUser();

            string fileName = Path.Combine("c:\\junk", "WordAddin", $"{Guid.NewGuid()}.docx");

            using (var file = File.Create(fileName))
            {
                file.Write(recordDocument.Data, 0, recordDocument.Data.Length);
                file.Close();
            }

            long uri;

            if (Int64.TryParse(GetCustomProperty(fileName, "CM_Record_Uri"), out uri))
            {
                using (Database db = getDatabase(userUPN))
                {
                    Record record = new Record(db, uri);

                    //    byte[] data = Convert.FromBase64String(result);


                    record.SetDocument(new InputDocument(fileName), true, recordDocument.KeepBookedOut, null);
                    record.Save();

                    File.Delete(fileName);
                    return(new RecordDocument(record));
                }
            }

            throw new ApplicationException($"Error with document");
        }
Exemplo n.º 2
0
        void recordDocument_OnPlayStateChanged(object sender, EventArgs e)
        {
            RecordDocument recordDocument = sender as RecordDocument;

            btnPlay.Visible  = recordDocument.PlayMode == PlayMode.MODE_PLAY ? false : true;
            btnPause.Visible = !btnPlay.Visible;
        }
Exemplo n.º 3
0
        public void TraceLogTest()
        {
            string              absoluteSiteUrl = string.Empty;                        // TODO: Initialize to an appropriate value
            RecordDocument      rd     = null;                                         // TODO: Initialize to an appropriate value
            CustomRouterManager target = new CustomRouterManager(absoluteSiteUrl, rd); // TODO: Initialize to an appropriate value
            string              header = string.Empty;                                 // TODO: Initialize to an appropriate value

            target.TraceLog(header);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Exemplo n.º 4
0
    public void SyncRankWithDocument(GameObject rank, RecordDocument document)
    {
        var name      = document.fields.name.stringValue;
        var score     = document.fields.score.integerValue;
        var nameText  = rank.transform.Find("Name").GetComponent <Text>();
        var scoreText = rank.transform.Find("Score").GetComponent <Text>();

        nameText.text  = name;
        scoreText.text = score;
    }
Exemplo n.º 5
0
        void recordController_OnRecordOpenSuccess(object sender, global::RecordEditor.Logic.RecordControllerEventArgs args)
        {
            RecordDocument recordDocument = sender as RecordDocument;

            recordDocument.OnPlayStateChanged    += new EventHandler(recordDocument_OnPlayStateChanged);
            recordDocument.OnPlayPositionChanged += new EventHandler(recordDocument_OnPlayPositionChanged);

            btnRewind.Enabled = true;
            btnPlay.Enabled   = true;
            TimeInterval      = new TimeInterval(0, recordDocument.Description.duration);
        }
        public void TraceLogTest()
        {
            List <SPList>        enabledLibraries = null;                                                                // TODO: Initialize to an appropriate value
            SPListItem           dropOffListItem  = null;                                                                // TODO: Initialize to an appropriate value
            SPListItemCollection routingRules     = null;                                                                // TODO: Initialize to an appropriate value
            RecordDocument       target           = new RecordDocument(enabledLibraries, dropOffListItem, routingRules); // TODO: Initialize to an appropriate value
            string header = string.Empty;                                                                                // TODO: Initialize to an appropriate value

            target.TraceLog(header);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Exemplo n.º 7
0
        public async Task Consume(ConsumeContext <CreateRecordMessageBusMessage> context)
        {
            var message        = context.Message;
            var recordDocument = RecordDocument.Create(
                message.Sku,
                message.Title,
                message.Description,
                message.Price);

            await _recordDocumentService.IndexAsync(recordDocument);

            _logger.LogInformation("Message consumed!");
        }
Exemplo n.º 8
0
 public void Open(int rank, RecordDocument document)
 {
     if (!string.IsNullOrEmpty(this.document.name))
     {
         return;
     }
     this.rank          = rank;
     this.document      = document;
     newRecordText.text = string.Format("New {0} Record !\nPlease Enter Your Name", rankText[rank]);
     input.text         = document.fields.name.stringValue;
     input.Select();
     gameObject.SetActive(true);
 }
Exemplo n.º 9
0
        public void can_insert_records()
        {
            var docs = new RecordDocument(Guid.NewGuid(), Guid.NewGuid().ToString());

            using (var session = theStore.OpenSession())
            {
                session.Store(docs);
                session.SaveChanges();
            }

            using (var query = theStore.QuerySession())
            {
                query.Query <RecordDocument>().Count().ShouldBe(3);
            }
        }
 public async Task IndexAsync(RecordDocument recordDocument)
 {
     var elasticClient = _clientCreator.CreateClient();
     await elasticClient.IndexAsync(recordDocument, x => x.Index(nameof(RecordDocument).ToLower()));
 }