本文整理汇总了C#中Dynamo.ViewModels.DynamoViewModel类的典型用法代码示例。如果您正苦于以下问题:C# DynamoViewModel类的具体用法?C# DynamoViewModel怎么用?C# DynamoViewModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DynamoViewModel类属于Dynamo.ViewModels命名空间,在下文中一共展示了DynamoViewModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GalleryViewModel
public GalleryViewModel(DynamoViewModel dynamoViewModel)
{
dvm = dynamoViewModel;
var pathManager = dynamoViewModel.Model.PathManager;
var galleryFilePath = pathManager.GalleryFilePath;
var galleryDirectory = Path.GetDirectoryName(galleryFilePath);
var version = dynamoViewModel.Model.UpdateManager.ProductVersion;
DynamoVersion = string.Format(Properties.Resources.GalleryDynamoVersion,
version.FileMajor,
version.FileMinor,
version.FileBuild);
contents = GalleryContents.Load(galleryFilePath).GalleryUiContents;
//Set image path relative to gallery Directory
SetImagePath(galleryDirectory);
currentContent = contents.FirstOrDefault();
if (currentContent != null) //if contents is not empty
{
currentContent.IsCurrent = true;
}
MoveNextCommand = new DelegateCommand(p => MoveIndex(true), o => contents.Count > 1);
MovePrevCommand = new DelegateCommand(p => MoveIndex(false), o => contents.Count > 1);
CloseGalleryCommand = new DelegateCommand(p => dvm.CloseGalleryCommand.Execute(null), o => true);
}
示例2: InstalledPackagesViewModel
public InstalledPackagesViewModel(DynamoViewModel dynamoViewModel, PackageLoader model)
{
this.Model = model;
this.dynamoViewModel = dynamoViewModel;
InitializeLocalPackages();
}
示例3: CrashPrompt
public CrashPrompt(CrashPromptArgs args, DynamoViewModel dynamoViewModel)
{
InitializeComponent();
productName = dynamoViewModel.BrandingResourceProvider.ProductName;
Title = string.Format(Wpf.Properties.Resources.CrashPromptDialogTitle, productName);
txtOverridingText.Text = string.Format(Wpf.Properties.Resources.CrashPromptDialogCrashMessage, productName);
if (args.HasDetails())
{
this.details = args.Details;
this.CrashDetailsContent.Text = args.Details;
this.btnDetails.Visibility = Visibility.Visible;
}
if (args.IsFilePath())
{
folderPath = Path.GetDirectoryName(args.FilePath);
btnOpenFolder.Visibility = Visibility.Visible;
}
if (args.IsDefaultTextOverridden())
{
string overridingText = args.OverridingText;
if (args.IsFilePath())
overridingText = overridingText.Replace("[FILEPATH]", args.FilePath);
ConvertFormattedTextIntoTextblock(this.txtOverridingText, overridingText);
}
}
示例4: UsageReportingAgreementPrompt
public UsageReportingAgreementPrompt(IBrandingResourceProvider resourceProvider, DynamoViewModel dynamoViewModel)
{
InitializeComponent();
Title = resourceProvider.GetString(Wpf.Interfaces.ResourceNames.ConsentForm.Title);
ConsentFormImageRectangle.Fill = new ImageBrush(
resourceProvider.GetImageSource(Wpf.Interfaces.ResourceNames.ConsentForm.Image));
viewModel = dynamoViewModel;
var instrumentationFile = "InstrumentationConsent.rtf";
if (viewModel.Model.PathManager.ResolveDocumentPath(ref instrumentationFile))
InstrumentationContent.File = instrumentationFile;
var googleAnalyticsFile = "GoogleAnalyticsConsent.rtf";
if (viewModel.Model.PathManager.ResolveDocumentPath(ref googleAnalyticsFile))
GoogleAnalyticsContent.File = googleAnalyticsFile;
AcceptUsageReportingTextBlock.Text =
string.Format(Wpf.Properties.Resources.ConsentFormInstrumentationCheckBoxContent,
dynamoViewModel.BrandingResourceProvider.ProductName);
AcceptUsageReportingCheck.IsChecked = UsageReportingManager.Instance.IsUsageReportingApproved;
AcceptAnalyticsReportingCheck.IsChecked = UsageReportingManager.Instance.IsAnalyticsReportingApproved;
}
示例5: AbstractMutator
protected AbstractMutator(Random rand)
{
this.Rand = rand;
this.Controller = dynSettings.Controller;
this.DynamoViewModel = Controller.DynamoViewModel;
this.DynamoModel = Controller.DynamoModel;
}
示例6: AboutWindow
public AboutWindow(DynamoViewModel dynamoViewModel)
{
InitializeComponent();
InstallNewUpdate = false;
PreviewKeyDown += new KeyEventHandler(HandleEsc);
DataContext = dynamoViewModel;
}
示例7: Cleanup
public override void Cleanup()
{
try
{
preloader = null;
DynamoSelection.Instance.ClearSelection();
if (ViewModel == null)
return;
var shutdownParams = new DynamoViewModel.ShutdownParams(
shutdownHost: false,
allowCancellation: false);
ViewModel.PerformShutdownSequence(shutdownParams);
ViewModel.RequestUserSaveWorkflow -= RequestUserSaveWorkflow;
ViewModel = null;
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
base.Cleanup();
}
示例8: OnRequestAboutWindow
public virtual void OnRequestAboutWindow(DynamoViewModel vm)
{
if (RequestAboutWindow != null)
{
RequestAboutWindow(vm);
}
}
示例9: ViewStartupParams
internal ViewStartupParams(DynamoViewModel dynamoVM) :
base(dynamoVM.Model.AuthenticationManager.AuthProvider,
dynamoVM.Model.PathManager,
dynamoVM.Model.CustomNodeManager)
{
dynamoViewModel = dynamoVM;
}
示例10: CodeBlockEditor
public CodeBlockEditor(NodeViewModel nodeViewModel)
{
InitializeComponent();
this.nodeViewModel = nodeViewModel;
this.dynamoViewModel = nodeViewModel.DynamoViewModel;
this.DataContext = nodeViewModel.NodeModel;
this.nodeModel = nodeViewModel.NodeModel as CodeBlockNodeModel;
// Register text editing events
this.InnerTextEditor.TextChanged += InnerTextEditor_TextChanged;
this.InnerTextEditor.TextArea.LostFocus += TextArea_LostFocus;
// the code block should not be in focus upon undo/redo actions on node
if (this.nodeModel.ShouldFocus)
{
this.Loaded += (obj, args) => this.InnerTextEditor.TextArea.Focus();
}
// Register auto-completion callbacks
this.InnerTextEditor.TextArea.TextEntering += OnTextAreaTextEntering;
this.InnerTextEditor.TextArea.TextEntered += OnTextAreaTextEntered;
InitializeSyntaxHighlighter();
}
示例11: PackageDownloadHandle
public PackageDownloadHandle(DynamoViewModel dynamoViewModel, Greg.Responses.PackageHeader header, PackageVersion version)
{
this.dynamoViewModel = dynamoViewModel;
this.Header = header;
this.DownloadPath = "";
this.VersionName = version.version;
}
示例12: PackageManagerClientViewModel
public PackageManagerClientViewModel(DynamoViewModel dynamoViewModel, PackageManagerClient packageManagerClient )
{
this.dynamoViewModel = dynamoViewModel;
this.packageManagerClient = packageManagerClient;
this.CachedPackageList = new List<PackageManagerSearchElement>();
this.packageManagerClient.RequestAuthentication +=
dynamoViewModel.OnRequestAuthentication;
}
示例13: AboutWindow
public AboutWindow(DynamoLogger logger, DynamoViewModel model)
{
InitializeComponent();
this.logger = logger;
this.InstallNewUpdate = false;
this.PreviewKeyDown += new KeyEventHandler(HandleEsc);
this.DataContext = model;
}
示例14: DynamoOpenFileDialog
public DynamoOpenFileDialog(DynamoViewModel model)
{
this.model = model;
_dialog = new NativeFileOpenDialog();
IFileDialogCustomize customize = (IFileDialogCustomize) _dialog;
customize.AddCheckButton(RunManualCheckboxId,
Dynamo.Wpf.Properties.Resources.FileDialogManualMode,
model.PreferenceSettings.OpenFileInManualExecutionMode);
}
示例15: ViewStartupParams
internal ViewStartupParams(DynamoViewModel dynamoVM) :
base(dynamoVM.Model.AuthenticationManager.AuthProvider,
dynamoVM.Model.PathManager,
new ExtensionLibraryLoader(dynamoVM.Model),
dynamoVM.Model.CustomNodeManager,
dynamoVM.Model.GetType().Assembly.GetName().Version)
{
dynamoViewModel = dynamoVM;
}