ReferencedAssemblies Property
ReferencedAssemblies
Gets collection of assemblies where the controls and components used on the form being designed are declared.
Declaration
[Browsable(false)]
public DesignerReferencedAssemblies ReferencedAssemblies { get; set; }
Property Value
Type | Description |
---|---|
DesignerReferencedAssemblies |
Implements
Remarks
ReferencedAssemblies contains a list of assembly names as well as a list of search paths and the path to the current framework. You can change the assembly name list or search path list by using the AddAssemblyName or AddSearchPath methods.
Examples
Here is how to use a ReferencedAssemblies in the C# code:
using System;
using Alternet.FormDesigner.Wpf;
public partial class MainWindow : Window
{
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var formDesigner = new FormDesignerControl();
formDesigner.AutoSaveToSource = false;
string fileName = "myfile.vb";
formDesigner.ReferencedAssemblies = GetReferencedAssemblies(fileName);
}
private DesignerReferencedAssemblies GetReferencedAssemblies(string fileName)
{
var defaultReferences = Path.GetExtension(fileName).ToLower().Equals(".vb") ?
DesignerReferencedAssemblies.DefaultForVisualBasic :
DesignerReferencedAssemblies.DefaultForCSharp;
return defaultReferences;
}
}
Here is how to use a ReferencedAssemblies in the Visual Basic code:
Imports System
Imports System.IO
Imports Alternet.FormDesigner.Wpf
Partial Public Class MainWindow
Inherits Window
Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim formDesigner = New FormDesignerControl()
formDesigner.AutoSaveToSource = False
Dim fileName As String = "myfile.vb"
formDesigner.ReferencedAssemblies = GetReferencedAssemblies(fileName)
End Sub
Private Function GetReferencedAssemblies(ByVal fileName As String) As DesignerReferencedAssemblies
Dim defaultReferences = If(Path.GetExtension(fileName).ToLower().Equals(".vb"), DesignerReferencedAssemblies.DefaultForVisualBasic, DesignerReferencedAssemblies.DefaultForCSharp)
Return defaultReferences
End Function
End Class