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


C# Codon类代码示例

本文整理汇总了C#中Codon的典型用法代码示例。如果您正苦于以下问题:C# Codon类的具体用法?C# Codon怎么用?C# Codon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Codon类属于命名空间,在下文中一共展示了Codon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToolBarCheckBox

		public ToolBarCheckBox(Codon codon, object caller)
		{
			ToolTipService.SetShowOnDisabled(this, true);
			
			this.codon = codon;
			this.caller = caller;
			this.Command = CommandWrapper.GetCommand(codon, caller, true);
			CommandWrapper wrapper = this.Command as CommandWrapper;
			if (wrapper != null) {
				ICheckableMenuCommand cmd = wrapper.GetAddInCommand() as ICheckableMenuCommand;
				if (cmd != null) {
					isCheckedBinding = SetBinding(IsCheckedProperty, new Binding("IsChecked") { Source = cmd, Mode = BindingMode.OneWay });
				}
			}
			
			if (codon.Properties.Contains("icon")) {
				var image = PresentationResourceService.GetImage(StringParser.Parse(codon.Properties["icon"]));
				image.Height = 16;
				image.SetResourceReference(StyleProperty, ToolBarService.ImageStyleKey);
				this.Content = image;
			} else {
				this.Content = codon.Id;
			}
			UpdateText();
			
			SetResourceReference(FrameworkElement.StyleProperty, ToolBar.CheckBoxStyleKey);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:27,代码来源:ToolBarCheckBox.cs

示例2: CommandWrapper

		public CommandWrapper(Codon codon, object caller, ICommand command)
		{
			this.codon = codon;
			this.caller = caller;
			this.addInCommand = command;
			commandCreated = true;
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:7,代码来源:MenuCommand.cs

示例3: MenuCheckBox

		public MenuCheckBox(Codon codon, object caller)
		{
			this.RightToLeft = RightToLeft.Inherit;
			this.caller = caller;
			this.codon  = codon;
			UpdateText();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:MenuCheckBox.cs

示例4: MenuSeparator

		public MenuSeparator(Codon codon, object caller, IEnumerable<ICondition> conditions)
		{
			this.RightToLeft = RightToLeft.Inherit;
			this.caller      = caller;
			this.codon       = codon;
			this.conditions  = conditions;
		}
开发者ID:lisiynos,项目名称:pascalabcnet,代码行数:7,代码来源:MenuSeparator.cs

示例5: ToolBarSplitButton

        public ToolBarSplitButton(Codon codon, object caller, ArrayList subItems, IEnumerable<ICondition> conditions)
        {
            this.RightToLeft = RightToLeft.Inherit;
            this.caller      = caller;
            this.codon       = codon;
            this.subItems	 = subItems;
            this.conditions  = conditions;

            if (codon.Properties.Contains("label")){
                Text = StringParser.Parse(codon.Properties["label"]);
            }
            if (imgButtonEnabled == null && codon.Properties.Contains("icon")) {
                imgButtonEnabled = WinFormsResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"]));
            }
            if (imgButtonDisabled == null && codon.Properties.Contains("disabledIcon")) {
                imgButtonDisabled = WinFormsResourceService.GetBitmap(StringParser.Parse(codon.Properties["disabledIcon"]));
            }
            if (imgButtonDisabled == null) {
                imgButtonDisabled = imgButtonEnabled;
            }
            menuCommand = codon.AddIn.CreateObject(codon.Properties["class"]) as ICommand;
            menuCommand.Owner = this;
            UpdateStatus();
            UpdateText();
        }
开发者ID:kanbang,项目名称:Colt,代码行数:25,代码来源:ToolBarSplitButton.cs

示例6: ToolBarCheckBox

		public ToolBarCheckBox(Codon codon, object caller, IEnumerable<ICondition> conditions)
		{
			ToolTipService.SetShowOnDisabled(this, true);
			
			this.codon = codon;
			this.caller = caller;
			this.conditions = conditions;
			this.Command = CommandWrapper.GetCommand(codon, caller, true, conditions);
			CommandWrapper wrapper = this.Command as CommandWrapper;
			if (wrapper != null) {
				ICheckableMenuCommand cmd = wrapper.GetAddInCommand() as ICheckableMenuCommand;
				if (cmd != null) {
#if ModifiedForAltaxo
					isCheckedBinding = SetBinding(IsCheckedProperty, new Binding("IsChecked") { Source = cmd, Mode = BindingMode.TwoWay });
#else
					isCheckedBinding = SetBinding(IsCheckedProperty, new Binding("IsChecked") { Source = cmd, Mode = BindingMode.OneWay });
#endif
				}
			}

			this.Content = ToolBarService.CreateToolBarItemContent(codon);
			if (codon.Properties.Contains("name")) {
				this.Name = codon.Properties["name"];
			}
			UpdateText();
			
			SetResourceReference(FrameworkElement.StyleProperty, ToolBar.CheckBoxStyleKey);
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:28,代码来源:ToolBarCheckBox.cs

示例7: ToolBarButton

		public ToolBarButton(UIElement inputBindingOwner, Codon codon, object caller, bool createCommand, IReadOnlyCollection<ICondition> conditions)
		{
			ToolTipService.SetShowOnDisabled(this, true);
			
			this.codon = codon;
			this.caller = caller;
			if (createCommand)
				this.Command = CommandWrapper.CreateCommand(codon, conditions);
			else
				this.Command = CommandWrapper.CreateLazyCommand(codon, conditions);
			this.CommandParameter = caller;
			this.Content = ToolBarService.CreateToolBarItemContent(codon);
			this.conditions = conditions;

			if (codon.Properties.Contains("name")) {
				this.Name = codon.Properties["name"];
			}

			if (!string.IsNullOrEmpty(codon.Properties["shortcut"])) {
				KeyGesture kg = MenuService.ParseShortcut(codon.Properties["shortcut"]);
				MenuCommand.AddGestureToInputBindingOwner(inputBindingOwner, kg, this.Command, GetFeatureName());
				this.inputGestureText = MenuService.GetDisplayStringForShortcut(kg);
			}
			UpdateText();
			
			SetResourceReference(FrameworkElement.StyleProperty, ToolBar.ButtonStyleKey);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:27,代码来源:ToolBarButton.cs

示例8: BuildItem

        public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems)
        {
            ServerStartup server = new ServerStartup();

            server.Startup();

            return server;
        }
开发者ID:W8023Y2014,项目名称:jsion,代码行数:8,代码来源:Start.cs

示例9: MenuCheckBox

		public MenuCheckBox(Codon codon, object caller, IEnumerable<ICondition> conditions)
		{
			this.RightToLeft = RightToLeft.Inherit;
			this.caller = caller;
			this.codon  = codon;
			this.conditions = conditions;
			UpdateText();
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:8,代码来源:MenuCheckBox.cs

示例10: ConditionalSeparator

		public ConditionalSeparator(Codon codon, object caller, bool inToolbar)
		{
			this.codon = codon;
			this.caller = caller;
			
			if (inToolbar) {
				SetResourceReference(FrameworkElement.StyleProperty, ToolBar.SeparatorStyleKey);
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:ConditionalSeparator.cs

示例11: CommandWrapper

		public CommandWrapper(Codon codon, object caller, ICommand command, IEnumerable<ICondition> conditions)
		{
			if (conditions == null)
				throw new ArgumentNullException("conditions");
			this.codon = codon;
			this.caller = caller;
			this.addInCommand = command;
			this.conditions = conditions;
			commandCreated = true;
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:10,代码来源:MenuCommand.cs

示例12: Menu

        public Menu(Codon codon, object caller, IList subItems)
        {
            if (subItems == null) subItems = new ArrayList(); // don't crash when item has no children
            this.codon    = codon;
            this.caller   = caller;
            this.subItems = subItems;
            this.RightToLeft = RightToLeft.Inherit;

            UpdateText();
        }
开发者ID:jiangguang5201314,项目名称:DotNetFramework,代码行数:10,代码来源:Menu.cs

示例13: ToolBarComboBox

		public ToolBarComboBox(Codon codon, object caller)
		{
			if (codon == null)
				throw new ArgumentNullException("codon");
			this.IsEditable = false;
			menuCommand = (IComboBoxCommand)codon.AddIn.CreateObject(codon.Properties["class"]);
			menuCommand.ComboBox = this;
			menuCommand.Owner = caller;
			
			SetResourceReference(FrameworkElement.StyleProperty, ToolBar.ComboBoxStyleKey);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:11,代码来源:ToolBarComboBox.cs

示例14: BuildItem

        public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems)
        {
            IMsgReceiver receiver = MsgMonitor.GetReceiver(codon.ID);

            if (receiver == null)
            {
                receiver = new GameConnecter(codon.ID);
            }

            return receiver;
        }
开发者ID:W8023Y2014,项目名称:jsion,代码行数:11,代码来源:ConnecterDoozer.cs

示例15: MenuCommand

		public MenuCommand(UIElement inputBindingOwner, Codon codon, object caller, string activationMethod, IReadOnlyCollection<ICondition> conditions) : base(codon, caller, conditions)
		{
			this.ActivationMethod = activationMethod;
			this.Command = CommandWrapper.CreateLazyCommand(codon, conditions);
			this.CommandParameter = caller;
			
			if (!string.IsNullOrEmpty(codon.Properties["shortcut"])) {
				KeyGesture kg = MenuService.ParseShortcut(codon.Properties["shortcut"]);
				AddGestureToInputBindingOwner(inputBindingOwner, kg, this.Command, GetFeatureName());
				this.InputGestureText = MenuService.GetDisplayStringForShortcut(kg);
			}
		}
开发者ID:Rew,项目名称:SharpDevelop,代码行数:12,代码来源:MenuCommand.cs


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