コード例 #1
0
ファイル: VsUtils.cs プロジェクト: rsdn/nitra
        public static TextViewModel GetOrCreateTextViewModel(IWpfTextView wpfTextView, FileModel fileModel)
        {
            TextViewModel textViewModel;

            if (!wpfTextView.Properties.TryGetProperty <TextViewModel>(Constants.TextViewModelKey, out textViewModel))
            {
                wpfTextView.Properties.AddProperty(Constants.TextViewModelKey, textViewModel = fileModel.GetOrAdd(wpfTextView));
            }
            return(textViewModel);
        }