本文整理汇总了C#中ViewType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ViewType.ToString方法的具体用法?C# ViewType.ToString怎么用?C# ViewType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewType
的用法示例。
在下文中一共展示了ViewType.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateButton
private void CreateButton(ViewType type, bool on = true)
{
int size = this.flowLayoutPanel1.Height;
StatusImageButton button = new StatusImageButton();
this.flowLayoutPanel1.Controls.Add(button);
button.Image = type.Bitmap();
button.Location = new System.Drawing.Point(0, 0);
button.Name = type.ToString();
button.Tag = type;
button.OffImageType = Sardauscan.Gui.Controls.eOffButtonType.NotSelected;
button.On = on;
button.Size = new System.Drawing.Size(size, size);
button.Click += OnButtonClick;
button.Margin = new Padding(0);
this.ToolTip.SetToolTip(button, type.ToString());
flowLayoutPanel1.Width = size * flowLayoutPanel1.Controls.Count;
flowLayoutPanel1.Height = size;
}
示例2: VSG_ViewChange
public void VSG_ViewChange(ViewType view)
{
Console.WriteLine("View Changed: {0}", view.ToString());
this.toolStripStatusLabel1.Text = view.ToString();
}
示例3: AddView
/// <summary>
/// Add a view to the list.
/// </summary>
/// <param name="isDefault">Represents whether this view is a default view.</param>
/// <param name="queryType">Represents the type of query condition of the view.</param>
/// <param name="viewType">Represents the type of the view to be created.</param>
/// <returns>The GUID of the view, which is also called the view name.</returns>
protected string AddView(bool isDefault, Query queryType, ViewType viewType)
{
string listName = TestSuiteBase.ListGUID;
string viewName = this.GenerateRandomString(5);
AddViewViewFields viewFields = new AddViewViewFields();
viewFields.ViewFields = this.GetViewFields(true);
AddViewQuery addViewQuery = new AddViewQuery();
addViewQuery.Query = this.GetCamlQueryRoot(queryType, false);
AddViewRowLimit rowLimit = new AddViewRowLimit();
rowLimit.RowLimit = this.GetAvailableRowLimitDefinition();
string type = string.Empty;
switch (viewType)
{
case ViewType.Calendar:
type = "Calendar";
break;
case ViewType.Grid:
type = "Grid";
break;
case ViewType.Html:
type = "Html";
break;
default:
Site.Debug.Fail("Not supported view type {0}", viewType.ToString());
break;
}
AddViewResponseAddViewResult addViewResponseAddViewResult = TestSuiteBase.Adapter.AddView(
listName,
viewName,
viewFields,
addViewQuery,
rowLimit,
type,
isDefault);
this.Site.Assert.IsNotNull(addViewResponseAddViewResult.View, "The call of the AddView operation SHOULD be successful.");
string viewGUID = addViewResponseAddViewResult.View.Name;
if (isDefault)
{
this.Site.Assert.IsNotNull(addViewResponseAddViewResult.View.DefaultView, "The response element \"addViewResponseAddViewResult.View.DefaultView\" should not be null.");
this.Site.Assert.AreEqual("true", addViewResponseAddViewResult.View.DefaultView.ToLower(), "The added view should be a default view.");
// If the new default view is added successfully, the original default view lost its default view position.
if (OriginalDefaultViewName != null)
{
if (TestSuiteBase.OriginalDefaultViewLost == false)
{
TestSuiteBase.OriginalDefaultViewLost = true;
}
}
}
TestSuiteBase.ViewPool.Add(viewGUID);
return addViewResponseAddViewResult.View.Name;
}
示例4: ChangeView
/// <summary>
/// change view
/// </summary>
/// <param name="view"></param>
/// <param name="parmeters"></param>
public void ChangeView(ViewType viewtype)
{
m_CurrentView = viewtype;
if (m_RegisteredViews.ContainsKey(viewtype))
{
View view = m_RegisteredViews[viewtype];
foreach (View v in m_RegisteredViews.Values)
{
bool vis = v.Type == view.Type;
if (v.BigControl != null)
v.BigControl.Visible = vis;
if (v.SmallControl!= null)
v.SmallControl.Visible = vis;
}
m_BigContainer.Controls.Clear();
m_SmallContainer.Controls.Clear();
if(view.BigControl!=null)
{
m_BigContainer.Controls.Add(view.BigControl);
view.BigControl.Dock = DockStyle.Fill;
view.BigControl.Visible = true;
}
if(view.SmallControl!=null)
{
m_SmallContainer.Controls.Add(view.SmallControl);
view.SmallControl.Dock = DockStyle.Fill;
view.SmallControl.Visible = true;
}
}
else
throw new Exception("View " + viewtype.ToString() + " is not registered");
FireViewChanged();
}
示例5: ShowItemType
private void ShowItemType(ViewType viewType)
{
object uiElement = Bag.FindName(viewType.ToString());
if (uiElement is DockPanel) {
(uiElement as DockPanel).Visibility = System.Windows.Visibility.Visible;
}
}