Ejemplo n.º 1
0
        public static DefaultSyncModel SetTextView(this SyncContent syncContent, string text)
        {
            var defaultSyncModel = new DefaultSyncModel()
            {
                Text = text
            };

            syncContent.SetView(defaultSyncModel);
            return(defaultSyncModel);
        }
Ejemplo n.º 2
0
        public static CancelSyncModel SetCancelView(this SyncContent syncContent, string text)
        {
            var cancelSyncModel = new CancelSyncModel()
            {
                Text = text
            };

            syncContent.SetView(cancelSyncModel);
            return(cancelSyncModel);
        }
Ejemplo n.º 3
0
        public async Task <SyncContent> EnterSync()
        {
            await semaphoreSlim.WaitAsync();

            var oldView = view.SyncView;

            view.SyncView = this;
            var syncContent = new SyncContent(this, () =>
            {
                try
                {
                    view.SyncView = oldView;
                }
                finally
                {
                    semaphoreSlim.Release();
                }
            });

            return(syncContent);
        }