예제 #1
0
        // Камера
        internal void CheckListSnapshot_OnClick(object sender, EventArgs eventArgs)
        {
            if (_readonly)
            {
                return;
            }
            _imgToReplace           = (Image)((VerticalLayout)sender).GetControl(0);
            _currentCheckListItemID = ((VerticalLayout)sender).Id;

            if (_imgToReplace.Source.StartsWith("~"))
            {
                Navigation.Move(nameof(PhotoScreen), new Dictionary <string, object>
                {
                    [Parameters.IdImage]      = _imgToReplace.Source,
                    [nameof(CheckListScreen)] = _currentCheckListItemID
                });
            }
            else if (_imgToReplace.Source == ResourceManager.GetImage("checklistscreen_photo"))
            {
                _newGuid   = Guid.NewGuid().ToString();
                _pathToImg = $@"\private\{_newGuid}.jpg";

                Camera.MakeSnapshot(_pathToImg, Settings.PictureSize, CameraCallback, _newGuid);
            }
        }
예제 #2
0
        private void btn_OnClick(object sender, EventArgs e)
        {
            var id       = Guid.NewGuid();
            var fileName = string.Format("shared/{0}", id);

            Camera.MakeSnapshot(fileName, 500,
                                delegate
            {
                //var photo = new Photos();
                //photo.Id = id;
                //photo.FileName = fileName;
                //photo.Save();
                UpdateSyncButton();
            }
                                );
        }
예제 #3
0
        void btn_OnClick(object sender, EventArgs e)
        {
            Guid   id       = Guid.NewGuid();
            String fileName = String.Format("shared/{0}", id.ToString());

            Camera.MakeSnapshot(fileName, 500,
                                delegate(object sender2, EventArgs e2)
            {
                Test.Model.Document.Photos photo = new Model.Document.Photos();
                photo.Id       = id;
                photo.FileName = fileName;
                photo.Save();

                BusinessProcess.DoBack();
            }
                                );
        }
예제 #4
0
        internal void RetakeButton_OnClick(object sender, EventArgs args)
        {
            var    guid    = Guid.NewGuid();
            string path    = $@"\private\{guid}.jpg";
            var    oldPath = _photo.Source.StartsWith("~") ? _photo.Source.Substring(1) : _photo.Source;

            Camera.MakeSnapshot(path, Settings.PictureSize, (o, eventArgs) =>
            {
                if (!eventArgs.Result)
                {
                    return;
                }
                FileSystem.Delete(oldPath);
                _photo.Source = "~" + path;
                _photo.Refresh();
                ChangePhotoInDB(guid.ToString());
                Navigation.Back();
            });
        }
 private void Camera_OnClick(object sender, EventArgs e)
 {
     Camera.MakeSnapshot("//private//test.jpg", 5, DconsoleWriteLine);
 }