コード例 #1
0
        private IStudioControl OpenControl(StrategyInfo info)
        {
            IStudioControl ctrl = null;

            switch (StrategyInfo.Type)
            {
            case StrategyInfoTypes.SourceCode:
            case StrategyInfoTypes.Analytics:
                ctrl = OpenControl(info.Id.To <string>(), typeof(StrategyInfoCodeContent), info, () =>
                {
                    var c = new StrategyInfoCodeContent {
                        StrategyInfo = info
                    };

                    ConfigManager
                    .GetService <IStudioCommandService>()
                    .Bind(info.GetKey(), c);

                    return(c);
                });
                break;

            case StrategyInfoTypes.Diagram:
                ctrl = OpenControl(info.Id.To <string>(), typeof(DiagramPanel), info, () =>
                {
                    var c = new DiagramPanel {
                        StrategyInfo = info
                    };

                    ConfigManager
                    .GetService <IStudioCommandService>()
                    .Bind(info.GetKey(), c);

                    return(c);
                });
                break;

            case StrategyInfoTypes.Assembly:
            case StrategyInfoTypes.Terminal:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(ctrl);
        }
コード例 #2
0
		private IStudioControl OpenControl(StrategyInfo info)
		{
			IStudioControl ctrl = null;

			switch (StrategyInfo.Type)
			{
				case StrategyInfoTypes.SourceCode:
				case StrategyInfoTypes.Analytics:
					ctrl = OpenControl(info.Id.To<string>(), typeof(StrategyInfoCodeContent), info, () =>
					{
						var c = new StrategyInfoCodeContent { StrategyInfo = info };

						ConfigManager
							.GetService<IStudioCommandService>()
							.Bind(info.GetKey(), c);

						return c;
					});
					break;

				case StrategyInfoTypes.Diagram:
					ctrl = OpenControl(info.Id.To<string>(), typeof(DiagramPanel), info, () =>
					{
						var c = new DiagramPanel { StrategyInfo = info };

						ConfigManager
							.GetService<IStudioCommandService>()
							.Bind(info.GetKey(), c);

						return c;
					});
					break;

				case StrategyInfoTypes.Assembly:
				case StrategyInfoTypes.Terminal:
					break;

				default:
					throw new ArgumentOutOfRangeException();
			}

			return ctrl;
		}