コード例 #1
0
ファイル: HtmlBox.xaml.cs プロジェクト: prayzzz/sharpsound
        private void BrowserOnLoadCompleted(object sender, NavigationEventArgs navigationEventArgs)
        {
            var webBrowser = ((WebBrowser)sender);
            var args       = new WebBrowserEventArgs((HTMLDocument)webBrowser.Document, webBrowser.Source);

            DocumentLoaded?.Invoke(sender, args);
        }
コード例 #2
0
 private void OnDocumentLoaded(DocumentLoaded msg)
 {
     Clear();
     foreach (var nodeId in _editor.CurrentDocument.GetNodeIdsInDrawOrder().Reverse())
     {
         AddSpriteNode(nodeId, _editor.CurrentDocument.GetNode(nodeId).Name);
     }
 }
コード例 #3
0
        private void OnDocumentLoaded(DocumentLoaded msg)
        {
            if (Editor == null)
            {
                return;
            }

            LoadCurrentDocument();
        }
コード例 #4
0
 private void OnDocumentLoaded(DocumentLoaded msg)
 {
     Animations.Clear();
     _index.Clear();
     foreach (var animation in msg.Document.GetAnimations())
     {
         AddAnimation(animation.Id, animation.Name);
     }
     _selectedAnimation = null;
 }
コード例 #5
0
 private void Browser_FrameLoadEnd1(object sender, FrameLoadEndEventArgs e)
 {
     if (e.Frame.IsMain)
     {
         Dispatcher.BeginInvoke(new Action(async() =>
         {
             if (_disposed)
             {
                 return;
             }
             DocumentLoaded?.Invoke(this, EventArgs.Empty);
         }));
     }
     //Browser.ShowDevTools();
 }
コード例 #6
0
        public async Task LoadDocumentAsync()
        {
            try
            {
                _tokenSource?.Cancel();
                _tokenSource = null;
                Documents.Clear();
            }
            catch (Exception e)
            {
                _logger.Error(e);
            }

            using (_tokenSource = new CancellationTokenSource())
            {
                var token = _tokenSource.Token;
                // ドキュメントデータ一覧をファイルから取得
                Directory.CreateDirectory(_config.Project);
                int index = 0;
                foreach (var directory in Directory.EnumerateDirectories(_config.Project, "*", SearchOption.AllDirectories)
                         .OrderByDescending(x => new FileInfo(x).LastWriteTimeUtc))
                {
                    if (TryGetDocumentMetaData(directory, out var data))
                    {
                        if ((index++ % 3) is 0)
                        {
                            await Task.Delay(1);
                        }

                        if (token.IsCancellationRequested || _tokenSource is null)
                        {
                            return;
                        }

                        Documents.Add(new ImageDocument(data, _config));
                    }
                }
                DocumentLoaded?.Invoke(this, EventArgs.Empty);
            }

            _tokenSource = null;
        }
コード例 #7
0
ファイル: EditorModel.cs プロジェクト: csuffyy/AvalonStudio
        public void OpenFile(ISourceFile file, IIntellisenseControl intellisense,
                             ICompletionAssistant completionAssistant)
        {
            if (ProjectFile != file)
            {
                if (System.IO.File.Exists(file.Location))
                {
                    using (var fs = System.IO.File.OpenText(file.Location))
                    {
                        TextDocument          = new TextDocument(fs.ReadToEnd());
                        TextDocument.FileName = file.Location;
                    }

                    ProjectFile = file;

                    RegisterLanguageService(intellisense, completionAssistant);

                    DocumentLoaded?.Invoke(this, new EventArgs());
                }
            }
        }
コード例 #8
0
 private void OnDocumentLoaded(DocumentLoaded msg)
 {
     Clear();
 }
コード例 #9
0
 protected virtual void OnDocumentLoaded(DocumentLoadedEventArgs e)
 {
     DocumentLoaded?.Invoke(this, e);
 }
コード例 #10
0
ファイル: AppDelegate.cs プロジェクト: vikingcodes/OurPlace
 internal void RaiseDocumentLoaded(GenericTextDocument document)
 {
     // Inform caller
     DocumentLoaded?.Invoke(document);
 }
コード例 #11
0
 public void OnDocumentLoaded(object sender, DocumentLoadedEventArgs e)
 {
     DocumentLoaded?.Invoke(sender, e);
 }
コード例 #12
0
 private async void OnProjectLoadedEvent(DocumentLoaded e)
 {
     await ChangeAssetFolderAsync(e.Document.AbsoluteAssetFolder);
 }