• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ViewContext

        public ViewContext(ControllerContext controllerContext, IView view, ViewDataDictionary viewData, TempDataDictionary tempData)
            : base(controllerContext) {
            if (controllerContext == null) {
                throw new ArgumentNullException("controllerContext");
            }
            if (view == null) {
                throw new ArgumentNullException("view");
            }
            if (viewData == null) {
                throw new ArgumentNullException("viewData");
            }
            if (tempData == null) {
                throw new ArgumentNullException("tempData");
            }

            View = view;
            ViewData = viewData;
            TempData = tempData;

            // propagate FormContext, e.g. inside a template
            ViewContext originalViewContext = controllerContext as ViewContext;
            if (originalViewContext != null) {
                FormContext = originalViewContext.FormContext;
            }
        }
开发者ID:Marceli,项目名称:JQueryGridTest,代码行数:25,代码来源:ViewContext.cs


示例17: Create

        public IPresenter Create(Type presenterType, Type viewType, IView viewInstance)
        {
            if (presenterType == null)
                throw new ArgumentNullException("presenterType");
            if (viewType == null)
                throw new ArgumentNullException("viewType");
            if (viewInstance == null)
                throw new ArgumentNullException("viewInstance");

            if (!container.Model.HasImplementationsFor(presenterType))
            {
                lock (registerLock)
                {
                    if (!container.Model.HasImplementationsFor(presenterType))
                    {
                        container.Configure(x => x.For(presenterType).HybridHttpOrThreadLocalScoped().Use(presenterType).Named(presenterType.Name));
                    }
                }
            }

            var args = new ExplicitArguments();
            args.Set("view");
            args.SetArg("view", viewInstance);

            return (IPresenter)container.GetInstance(presenterType, args);
        }
开发者ID:unochild,项目名称:webformsmvp,代码行数:26,代码来源:StructureMapPresenterFactory.cs


示例18: ControlWrapperView

        /// <summary>Constructor.</summary>
        /// <param name="divHost">The control host DIV.</param>
        /// <param name="control">The logical IView control (null if not available).</param>
        /// <param name="htmlElement">The control content (supplied by the test class. This is the control that is under test).</param>
        /// <param name="displayMode">The sizing strategy to use for the control.</param>
        /// <param name="allViews">The Collection of all controls.</param>
        public ControlWrapperView(
            jQueryObject divHost, 
            IView control, 
            jQueryObject htmlElement, 
            ControlDisplayMode displayMode, 
            IEnumerable allViews) : base(divHost)
        {
            // Setup initial conditions.
            this.control = control;
            this.htmlElement = htmlElement;
            this.displayMode = displayMode;
            this.allViews = allViews;
            index = divHost.Children().Length; // Store the order position of the control in the host.
            events = Common.Events;

            // Create the wrapper DIV.
            divRoot = Html.CreateDiv();
            divRoot.CSS(Css.Position, Css.Absolute);
            divRoot.AppendTo(divHost);

            // Insert the content.
            htmlElement.CSS(Css.Position, Css.Absolute);
            htmlElement.AppendTo(divRoot);

            // Wire up events.
            events.ControlHostSizeChanged += OnHostResized;

            // Finish up.
            UpdateLayout();
        }
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:36,代码来源:ControlWrapperView.cs


示例19: Presenter

 public Presenter(IStabilityModel model, IView view)
 {
     _model = model;
     _view = view;
     _view.ViewUpdated += ViewOnViewUpdated;
     _view.DeviceCmdEvent += ViewOnDeviceCmdEvent;
 }
开发者ID:DrStein2013,项目名称:Stability,代码行数:7,代码来源:StabilityPresenter.cs


示例20: Create

        public IPresenter Create(Type presenterType, Type viewType, IView viewInstance)
        {
            // If a PresenterBinding attribute is applied directly to a view and the ViewType
            // property is not explicitly set, it will be defaulted to the view type. In a
            // user control example, this will be a type like ASP.usercontrols_mycontrol_ascx.
            // If we register it into the container using this type, and then try and resolve
            // a presenter like Presenter<IView> unity will throw an exception because it
            // doesn't use covariance when resolving dependencies. To get around this, we
            // look at the generic type argument on the presenter type (in this case, IView)
            // and register the view instance against that instead.
            if (viewType == viewInstance.GetType())
            {
                viewType = FindPresenterDescribedViewTypeCached(presenterType, viewInstance);
            }

            var presenterScopedContainer = container.CreateChildContainer();
            presenterScopedContainer.RegisterInstance(viewType, viewInstance);

            var presenter = (IPresenter)presenterScopedContainer.Resolve(presenterType);

            lock (presentersToContainersSyncLock)
            {
                presentersToContainers[presenter] = presenterScopedContainer;
            }

            return presenter;
        }
开发者ID:phiree,项目名称:dzdocs,代码行数:27,代码来源:UnityPresenterFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IViewContent类代码示例发布时间:2022-05-24
下一篇:
C# IVideoWindow类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap