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


C# IView类代码示例

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


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

示例1: PlayGame

        public PlayGame(Game game, IView view)
        {
            a_game = game;
            a_view = view;

            a_game.AddSubscribers(this);
        }
开发者ID:henceee,项目名称:1DV607,代码行数:7,代码来源:PlayGame.cs

示例2: UpdateContentItemAction

        public UpdateContentItemAction(IView view, IController con, ContentItem item, PropertyDescriptor property, object previousValue)
        {
            _view = view;
            _con = con;

            _state = ContentItemState.Get(item);

            var name = property.Name;
            var value = previousValue;

            if (name == "Importer")
            {
                name = "ImporterName";
                value = ((ImporterTypeDescription)value).TypeName;
            }

            if (name == "Processor")
            {
                name = "ProcessorName";
                value = ((ProcessorTypeDescription)value).TypeName;
            }

            var field = _state.GetType().GetMember(name).SingleOrDefault() as FieldInfo;
            if (field == null)
            {
                if (!_state.ProcessorParams.ContainsKey(name))
                    throw new Exception();

                _state.ProcessorParams[name] = value;
            }
            else
            {
                field.SetValue(_state, value);
            }
        }
开发者ID:KennethYap,项目名称:MonoGame,代码行数:35,代码来源:UpdateAction.cs

示例3: StrataOnTunnel

        // tunnelX, tunnelZ is the coordinate of tunnel crown
        // h is the height of tunnel
        //
        public static List<Result> StrataOnTunnel(double tunnelX, double tunnelZ, double h,
            IView profileView, string stLayerID, Setting setting)
        {
            IGraphicsLayer gLayerSt = profileView.getLayer(stLayerID);
            if (gLayerSt == null)
                return null;

            List<Result> results = new List<Result>();

            Project prj = Globals.project;
            Domain geology = prj.getDomain(DomainType.Geology);
            DGObjectsCollection stratum = geology.getObjects("Stratum");
            var stratumList = stratum.merge();
            foreach (DGObject obj in stratumList)
            {
                Stratum strata = obj as Stratum;
                IGraphicCollection gc = gLayerSt.getGraphics(strata);

                if (gc == null)
                    continue;

                Result result = StratumOnTunnel(tunnelX, tunnelZ, h, gc, profileView.spatialReference);
                if (result != null)
                {
                    result.StratumObj = gLayerSt.getObject(gc[0]);
                    if (result.Depth > 0 || setting.AllStrata)
                        results.Add(result);
                }
            }
            return results;
        }
开发者ID:iS3-Project,项目名称:iS3,代码行数:34,代码来源:StratumMappingUtility.cs

示例4: Presenter

 public Presenter(IView view,ILogger log)
 {
     _view = view;
     _log = log;
     this._view.Loaded += OnLoaded;
     this._view.ErrorOccured += OnError;
 }
开发者ID:kalamaja,项目名称:aout2,代码行数:7,代码来源:Listing5-9.cs

示例5: Create

 public WinFormsMvp.IPresenter Create(Type presenterType, Type viewType, IView viewInstance)
 {
     using (var scope = ObjectHost.Host.BeginLifetimeScope())
     {
         return scope.Resolve(presenterType, new NamedParameter("view", viewInstance)) as IPresenter;
     }
 }
开发者ID:zesus19,项目名称:c5.v1,代码行数:7,代码来源:AutofacPresenterFactory.cs

示例6: Create

        /// <summary>
        /// Creates the specified Presenter type. Called by the Web Forms MVP Framework.
        /// </summary>
        /// <param name="presenterType">Type of the presenter. Must be of type EPiPresenter<TView, TPageDataType> and the type arguments must be of the same type as the View and View Page Data Type, respectively.</param>
        /// <param name="viewType">Type of the view. Must be a subclass of EPiView.</param>
        /// <param name="viewInstance">The view instance. Must be a child of EPiView.</param>
        /// <returns></returns>
        public IPresenter Create(Type presenterType, Type viewType, IView viewInstance)
        {
            // Validate the View
            if (!typeof(IEPiView).IsAssignableFrom(viewType))
                throw new InvalidCastException("This kernel can (and should) only create a presenter if the View implements IEPiView. Got " + viewType);

            var epiView = viewInstance as IEPiView; // Unchecked cast is ok sicne we check it above.
            if (epiView.CurrentPage == null)
                throw new NullReferenceException("CurrentPage property of the viewInstance was null. The presenter needs a proper page data to render. ");

            Type pageDataType = GetPageDataType(epiView);

            Type genericPresenterViewType = GetGenericPresenterViewType(viewType);

            // Validate and check the Presenter type.
            var pageDataPresenterType = typeof(EPiPageDataPresenter<,>).MakeGenericType(new Type[] { genericPresenterViewType, pageDataType });
            if (presenterType.IsSubclassOf(pageDataPresenterType))
            {
                // Check if the Presenter has a usable constructor.
                if (!CanCreatePageDataPresenterInstance(viewType, pageDataType, presenterType))
                    throw new NullReferenceException("Did not find a suitable constructor on the presenter of type " + presenterType +
                                                     ". "
                                                     + "The presenter constructor requires two parameters, the FIRST one accepting a " +
                                                     viewType + " and a the SECOND one a " + pageDataType + ".");
                return
                    (IPresenter) CreatePageDataPresenterInstance(presenterType, (TypedPageData) epiView.CurrentPage, viewType, epiView);
            }
            return (IPresenter)CreatePresenterInstance(presenterType, viewType, epiView);
        }
开发者ID:MikeHook,项目名称:EPiServer-MVP,代码行数:36,代码来源:EPiPresenterFactory.cs

示例7: ViewModel

        public ViewModel(IView view)
        {
            _view = view;

            StartCmd = new RelayCommand(Start, () => _subscription == null);
            StopCmd = new RelayCommand(Stop, () => _subscription != null);
        }
开发者ID:stasi009,项目名称:TestDrivenLearn,代码行数:7,代码来源:ViewModel.cs

示例8: UpdateProjectAction

        public UpdateProjectAction(IView view, IController con, PipelineProject item, PropertyDescriptor property, object previousValue)
        {
            _view = view;
            _con = con;

            _state = ProjectState.Get(item);

            switch (property.Name)
            {
                case "OutputDir":
                    _state.OutputDir = (string)previousValue;
                    break;
                case "IntermediateDir":
                    _state.IntermediateDir = (string)previousValue;
                    break;
                case "References":
                    _state.References = new List<string>((List<string>)previousValue);
                    _referencesChanged = true;
                    break;
                case "Platform":
                    _state.Platform = (TargetPlatform)previousValue;
                    break;
                case "Profile":
                    _state.Profile = (GraphicsProfile)previousValue;
                    break;
                case "Config":
                    _state.Config = (string)previousValue;
                    break;
                case "OriginalPath":
                    _state.OriginalPath = (string)previousValue;
                    break;
            }
        }
开发者ID:Zodge,项目名称:MonoGame,代码行数:33,代码来源:PipelineController.UpdateProjectAction.cs

示例9: RegisterMessage

    /// <summary>
    /// 注册消息
    /// </summary>
    /// <param name="view"></param>
    /// <param name="messages"></param>
    protected void RegisterMessage(IView view, List<string> messages) 
    {
        if (messages == null || messages.Count == 0) 
            return;

        Controller.Instance.RegisterViewCommand(view, messages.ToArray());
    }
开发者ID:zh423328,项目名称:RunAway,代码行数:12,代码来源:View.cs

示例10: AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewsWithNoAttributes

        public void AttributeBasedPresenterDiscoveryStrategy_GetBindings_MultipleViewsWithNoAttributes()
        {
            // Arrange
            var strategy = new AttributeBasedPresenterDiscoveryStrategy();
            var hosts = new object[0];
            var view1 = new View1();
            var view2 = new View2();
            var views = new IView[] { view1, view2 };

            // Act
            var results = strategy.GetBindings(hosts, views).ToArray();

            // Assert
            CollectionAssert.AreEqual(new[]
                {
                    new PresenterDiscoveryResult
                    (
                        new[] {view1},
                        @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithNoAttributes+View1",
                        new PresenterBinding[0]
                    ),
                    new PresenterDiscoveryResult
                    (
                        new[] {view2},
                        @"AttributeBasedPresenterDiscoveryStrategy:
- could not find a [PresenterBinding] attribute on view instance WebFormsMvp.UnitTests.Binder.AttributeBasedPresenterDiscoveryStrategyTests.GetBindings_MultipleViewsWithNoAttributes+View2",
                        new PresenterBinding[0]
                    )
                },
                results
            );
        }
开发者ID:unochild,项目名称:webformsmvp,代码行数:33,代码来源:GetBindings_MultipleViewsWithNoAttributes.cs

示例11: ResolvedUrls

        public ResolvedUrls(IView view)
        {
            if(view == null)
                throw new ArgumentNullException("view");

            this._view = view;
        }
开发者ID:HansKindberg-Net,项目名称:HansKindberg-Web-MVP,代码行数:7,代码来源:ResolvedUrls.cs

示例12: ViewModel

 public ViewModel(IView view)
 {
     model = new Model();
     this.view = view;
     view.btnPressed += btnPressed;
     view.onBtnPressed += onBtnPressed;
 }
开发者ID:kverhun,项目名称:Animation,代码行数:7,代码来源:ViewModel.cs

示例13: CommandServicePresenter

   public CommandServicePresenter(IView view, IService service,
 ICommandExecutor executor)
   {
       _view = view;
         _service = service;
         _executor = executor;
   }
开发者ID:butaji,项目名称:Sapphire,代码行数:7,代码来源:CommandServicePresenter.cs

示例14: GetViews

		protected override IView[] GetViews(IView view)
		{
			MonoBehaviour mono = view as MonoBehaviour;
			Component[] components = mono.GetComponentsInChildren (typeof(IView), true);
			IView[] views = components.Cast<IView>().ToArray();
			return views;
		}
开发者ID:Niller,项目名称:LastStand,代码行数:7,代码来源:MediationBinder.cs

示例15: BackupForm

        public BackupForm(IBackupPresenter presenter, IView mainview)
            : base(mainview)
        {
            InitializeComponent();

            this.presenter = presenter;
        }
开发者ID:ricardoborges,项目名称:OpenSGA,代码行数:7,代码来源:BackupForm.cs


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