当前位置: 首页>>代码示例>>C#>>正文


C# ViewType.ToString方法代码示例

本文整理汇总了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;
		}
开发者ID:robotsrulz,项目名称:Sardauscan,代码行数:18,代码来源:ViewSelector.cs

示例2: VSG_ViewChange

 public void VSG_ViewChange(ViewType view)
 {
     Console.WriteLine("View Changed: {0}", view.ToString());
     this.toolStripStatusLabel1.Text = view.ToString();
 }
开发者ID:wshanshan,项目名称:DDD,代码行数:5,代码来源:VSGForm.cs

示例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;
        }
开发者ID:OfficeDev,项目名称:Interop-TestSuites,代码行数:70,代码来源:TestSuiteBase.cs

示例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();
		}
开发者ID:robotsrulz,项目名称:Sardauscan,代码行数:40,代码来源:ViewControler.cs

示例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;
     }
 }
开发者ID:Olegna,项目名称:PawnGuard,代码行数:7,代码来源:BagItemControl.xaml.cs


注:本文中的ViewType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。