Ejemplo n.º 1
0
        public object BuildItem(BuildItemArgs args)
        {
            string entityName = args.Codon.Properties["entityName"];

            string addinFileName = AppDomain.CurrentDomain.BaseDirectory + "AddIns\\" + "Related.AddIn";
            AddIn  addin         = AddIn.Load(addinFileName);

            List <Codon> subItems = GetSubItems(entityName, addin, args);

            if (subItems.Count <= 0)
            {
                return(null);
            }

            ICSharpCode.Core.Properties properies = new ICSharpCode.Core.Properties();
            properies.Set <string>("id", "RelatedGroup");
            properies.Set <string>("type", "Group");
            properies.Set <string>("label", "${res:Related}");
            properies.Set <string>("OrderNumber", "98");
            properies.Set <string>("builderid", "RibbonPageGroupBuilder");
            Codon codon = new Codon(addin, "MenuItem", properies, args.Conditions.ToArray());

            args.SubItemNode.AddCodons(subItems);
            return(new MenuItemDescriptor(args.Caller, codon, args.BuildSubItems <object>(), args.Conditions));
        }
Ejemplo n.º 2
0
		void LoadSubItems(TemplateCategory category, BuildItemArgs args)
		{
			foreach (TemplateBase item in args.BuildSubItems<TemplateBase>()) {
				if (item is TemplateCategory)
					category.Subcategories.Add((TemplateCategory)item);
				else
					category.Templates.Add(item);
			}
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Creates an item with the specified sub items. And the current
		/// Condition status for this item.
		/// </summary>
		public object BuildItem(BuildItemArgs args)
		{
			string label = args.Codon["label"];
			string id = args.Codon.Id;
			bool isPlotColorSet = args.Codon.Properties.Get<bool>("IsPlotColorSet", false);

			var subItems = args.BuildSubItems<NamedColor>();
			var result = new ColorSet(label, subItems);

			return new Tuple<IColorSet, bool>(result, isPlotColorSet);
		}
Ejemplo n.º 4
0
        /// <summary>
        /// Creates an item with the specified sub items. And the current
        /// Condition status for this item.
        /// </summary>
        public object BuildItem(BuildItemArgs args)
        {
            string label          = args.Codon["label"];
            string id             = args.Codon.Id;
            bool   isPlotColorSet = args.Codon.Properties.Get <bool>("IsPlotColorSet", false);

            var subItems = args.BuildSubItems <NamedColor>();
            var result   = new ColorSet(label, subItems);

            return(new Tuple <IColorSet, bool>(result, isPlotColorSet));
        }
 void LoadSubItems(TemplateCategory category, BuildItemArgs args)
 {
     foreach (TemplateBase item in args.BuildSubItems <TemplateBase>())
     {
         if (item is TemplateCategory)
         {
             category.Subcategories.Add((TemplateCategory)item);
         }
         else
         {
             category.Templates.Add(item);
         }
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates an item with the specified sub items. And the current
        /// Condition status for this item.
        /// </summary>
        public object BuildItem(BuildItemArgs args)
        {
            string label = args.Codon["label"];
            string id = args.Codon.Id;

            var sub_items = args.BuildSubItems<IOptionPanelDescriptor>();
            if(sub_items.Count == 0){
                if(args.Codon.Properties.Contains("class"))
                    return new DefaultOptionPanelDescriptor(id, label, args.AddIn, args.Parameter, args.Codon["class"]);
                else
                    return new DefaultOptionPanelDescriptor(id, label, args.AddIn);
            }

            return new DefaultOptionPanelDescriptor(id, label, args.AddIn, sub_items);
        }
Ejemplo n.º 7
0
		/// <summary>
		/// Creates an item with the specified sub items. And the current
		/// Condition status for this item.
		/// </summary>
		public object BuildItem(BuildItemArgs args)
		{
			string label = args.Codon["label"];
			string id = args.Codon.Id;
			
			var subItems = args.BuildSubItems<IDialogPanelDescriptor>();
			if (subItems.Count == 0) {
				if (args.Codon.Properties.Contains("class")) {
					return new DefaultDialogPanelDescriptor(id, StringParser.Parse(label), args.AddIn, args.Codon["class"]);
				} else {
					return new DefaultDialogPanelDescriptor(id, StringParser.Parse(label));
				}
			}
			
			return new DefaultDialogPanelDescriptor(id, StringParser.Parse(label), subItems);
		}
        /// <summary>
        /// Creates an item with the specified sub items. And the current
        /// Condition status for this item.
        /// </summary>
        public object BuildItem(BuildItemArgs args)
        {
            string label = args.Codon["label"];
            string id    = args.Codon.Id;

            var subItems = args.BuildSubItems <IOptionPanelDescriptor>();

            if (subItems.Count == 0)
            {
                if (args.Codon.Properties.Contains("class"))
                {
                    return(new DefaultOptionPanelDescriptor(id, StringParser.Parse(label), args.AddIn, args.Parameter, args.Codon["class"]));
                }
                else
                {
                    return(new DefaultOptionPanelDescriptor(id, StringParser.Parse(label)));
                }
            }

            return(new DefaultOptionPanelDescriptor(id, StringParser.Parse(label), subItems));
        }
Ejemplo n.º 9
0
		public object BuildItem(BuildItemArgs args)
		{
			return new ToolbarItemDescriptor(args.Parameter, args.Codon, args.BuildSubItems<object>(), args.Conditions);
		}
Ejemplo n.º 10
0
		public object BuildItem(BuildItemArgs args)
		{
			return new MenuItemDescriptor(args.Caller, args.Codon, args.BuildSubItems<object>());
		}
Ejemplo n.º 11
0
 public object BuildItem(BuildItemArgs args)
 {
     return(new NavItemDescriptor(args.Caller, args.Codon, args.BuildSubItems <object>()));
 }
Ejemplo n.º 12
0
 public object BuildItem(BuildItemArgs args)
 {
     return(new RibbonItemDescriptor(args.Caller, args.Codon, args.BuildSubItems <object>(), args.Conditions));
 }