本文整理汇总了C#中Page.GetView方法的典型用法代码示例。如果您正苦于以下问题:C# Page.GetView方法的具体用法?C# Page.GetView怎么用?C# Page.GetView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page.GetView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TabOrderDialog
/// <summary>
/// Constructor for the class
/// </summary>
public TabOrderDialog(Page page, DataSets.TabOrders.TabOrderDataTable tabOrderForFields)
{
// This call is required by the Windows Form Designer.
InitializeComponent();
currentPage = page;
currentView = page.GetView();
fieldsTabOrder = tabOrderForFields;
}
示例2: LoadPanel
/// <summary>
/// Loads the current panel
/// </summary>
private void LoadPanel(Page page)
{
DataRow row = page.GetMetadata().GetPageSetupData(page.GetView());
if (_fieldPanel != null)
{
foreach (Control control in _fieldPanel.Controls)
{
control.Font = null; //GDI Memory leak
}
}
_fieldPanel = new Panel();
float dpiX;
Graphics graphics = _fieldPanel.CreateGraphics();
dpiX = graphics.DpiX;
try
{
int height = (int)row["Height"];
int width = (int)row["Width"];
if (dpiX != 96)
{
float scaleFactor = (dpiX * 1.041666666f) / 100;
height = Convert.ToInt32(((float)height) * (float)scaleFactor);
width = Convert.ToInt32(((float)width) * (float)scaleFactor);
}
if (row["Orientation"].ToString() == "Landscape")
{
_fieldPanel.Size = new System.Drawing.Size(height, width);
}
else
{
_fieldPanel.Size = new System.Drawing.Size(width, height);
}
canvas.Size = _fieldPanel.Size;
canvas.SetPanelProperties(_fieldPanel);
currentPage = page;
ControlFactory factory = ControlFactory.Instance;
canvas.canvasPanel.Size = new Size(_fieldPanel.Size.Width, _fieldPanel.Size.Height);
List<Control> controls = factory.GetPageControls(page, canvas.canvasPanel.Size);
canvas.AddControlsToPanel(controls, _fieldPanel);
SetZeeOrderOfGroups(_fieldPanel);
_fieldPanel.Visible = false;
_fieldPanel.SendToBack();
foreach (Control controlOnPanel in _fieldPanel.Controls)
{
if (controlOnPanel is DataGridView)
{
((DataGridView)controlOnPanel).DataSource = null;
}
}
while (canvas.canvasPanel.Controls.Count > 0)
canvas.canvasPanel.Controls[0].Dispose();//User Handles Memory leak
// canvas.canvasPanel.Controls.Clear();
canvas.canvasPanel.Controls.Add(_fieldPanel);
}
finally
{
}
}
示例3: projectExplorer_PageSelected
/// <summary>
/// Handles the Page Selected event of the project explorer
/// </summary>
/// <param name="page">The page selected</param>
private void projectExplorer_PageSelected(Page page)
{
this.Text = SharedStrings.MAKE_VIEW_WINDOW_TITLE + " - [" + page.GetProject().FilePath + "\\" + page.GetView().Name + "\\" + page.Name + "]";
projectExplorer.SaveFieldVariables();
ChangeBackgroundData();
if (this.PageChanged != null)
{
this.PageChanged(this, new EventArgs());
}
}
示例4: SetCanvasDisplayProperties
/// <summary>
/// Sets the location and sized of the panel designer on the main form canvas.
/// </summary>
/// <param name="page"></param>
/// <returns>The size of the panel designer.</returns>
public Size SetCanvasDisplayProperties(Page page)
{
View view;
if (page != null)
{
view = page.GetView();
}
else
{
return new Size();
}
if (page.GetView().Project == null)
{
return new Size();
}
DataRow row = view.Project.Metadata.GetPageSetupData(view);
string orientation;
int height;
int width;
if (row["Orientation"] is System.DBNull || row["Width"] is System.DBNull || row["Height"] is System.DBNull)
{
orientation = (string)config.Settings["DefaultPageOrientation"];
height = (int)config.Settings["DefaultPageHeight"];
width = (int)config.Settings["DefaultPageWidth"];
}
else
{
orientation = row["Orientation"].ToString();
width = (int)row["Width"];
height = (int)row["Height"];
}
float dpiX;
Graphics graphics = this.CreateGraphics();
dpiX = graphics.DpiX;
if (dpiX != 96)
{
float scaleFactor = (dpiX * 1.041666666f) / 100;
height = Convert.ToInt32(((float)height) * (float)scaleFactor);
width = Convert.ToInt32(((float)width) * (float)scaleFactor);
}
if (orientation.ToLower() == "landscape")
{
PagePanel.Size = new Size(height, width);
}
else
{
PagePanel.Size = new Size(width, height);
}
int darkControlWidth = makeViewForm.Size.Width - makeViewForm.projectExplorer.Size.Width;
int leftMargin = (darkControlWidth - PagePanel.Size.Width) / 2;
leftMargin = leftMargin < 8 ? 8 : leftMargin;
int topMargin = 0;
PagePanel.Location = new Point(leftMargin, topMargin);
return PagePanel.Size;
}
示例5: SetFocusToFirstControl
/// <summary>
/// Sets the focus to the first input control on the current panel
/// </summary>
/// <param name="currentPage">The current page</param>
/// <param name="currentPanel">The current panel</param>
public void SetFocusToFirstControl(Page currentPage, Panel currentPanel)
{
#region Input Validation
if (currentPage == null)
{
throw new ArgumentNullException("Epi.Windows.Enter.SetFocusToFirstControl currentPage is null");
}
if (currentPanel == null)
{
throw new ArgumentNullException("Epi.Windows.Enter.SetFocusToFirstControl currentPanel is null");
}
#endregion //Input Validation
double minTabIndex = currentPage.GetMetadata().GetMinTabIndex(currentPage.Id, currentPage.GetView().Id);
if (minTabIndex != -1)
{
foreach (Control control in currentPanel.Controls)
{
if (control is TextBox || control is RichTextBox || control is CheckBox || control is ComboBox || control is MaskedTextBox || control is Button)
{
Epi.Windows.Enter.PresentationLogic.ControlFactory factory = Epi.Windows.Enter.PresentationLogic.ControlFactory.Instance;
Field field = factory.GetAssociatedField(control);
((RenderableField)field).Tag = "";
}
}
foreach (Control control in currentPanel.Controls)
{
if (control is TextBox || control is RichTextBox || control is CheckBox || control is ComboBox || control is MaskedTextBox || control is Button)
{
Epi.Windows.Enter.PresentationLogic.ControlFactory factory = Epi.Windows.Enter.PresentationLogic.ControlFactory.Instance;
Field field = factory.GetAssociatedField(control);
if (((RenderableField)field).TabIndex == minTabIndex)
{
if (control.Enabled)
{
// The problem with calling SetFocusToControl directly is that
// later on, other controls steal the focus in ways that we
// cannot control. This theft has unintended side-effects, e.g
// running check code in ways that aren't desired, and/or the focus
// doesn't actually get placed in the first field of the page in
// some cases. By invoking the method, we pass it to the message queue
// and it is run after the other focus-stealing events are called.
// EK 12/7/2010
this.BeginInvoke(new MethodInvoker(delegate() { SetFocusToControl(control, field); }));
((RenderableField)field).Tag = "tabbed";
return;
}
else
{
GoToNextControl(currentPage, currentView, control);
}
}
}
}
}
}