本文整理汇总了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);
}
示例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);
}
}
示例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;
}
示例4: Presenter
public Presenter(IView view,ILogger log)
{
_view = view;
_log = log;
this._view.Loaded += OnLoaded;
this._view.ErrorOccured += OnError;
}
示例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;
}
}
示例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);
}
示例7: ViewModel
public ViewModel(IView view)
{
_view = view;
StartCmd = new RelayCommand(Start, () => _subscription == null);
StopCmd = new RelayCommand(Stop, () => _subscription != null);
}
示例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;
}
}
示例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());
}
示例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
);
}
示例11: ResolvedUrls
public ResolvedUrls(IView view)
{
if(view == null)
throw new ArgumentNullException("view");
this._view = view;
}
示例12: ViewModel
public ViewModel(IView view)
{
model = new Model();
this.view = view;
view.btnPressed += btnPressed;
view.onBtnPressed += onBtnPressed;
}
示例13: CommandServicePresenter
public CommandServicePresenter(IView view, IService service,
ICommandExecutor executor)
{
_view = view;
_service = service;
_executor = executor;
}
示例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;
}
示例15: BackupForm
public BackupForm(IBackupPresenter presenter, IView mainview)
: base(mainview)
{
InitializeComponent();
this.presenter = presenter;
}