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


C# IScreen类代码示例

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


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

示例1: ContextMenuModel

 public ContextMenuModel(IScreen owner, string name, string displayName, Bitmap image = null)
 {
     Owner = owner;
     Name = name;
     DisplayName = displayName;
     Image = image;
 }
开发者ID:roycornelissen,项目名称:ServiceInsight,代码行数:7,代码来源:ContextMenuModel.cs

示例2: EdgeMovement

 /// <summary>
 /// Erzeugt eine neue Instanz eines EdgeMovement-Objekts und initialisiert diese
 /// mit ihrem zugehörigen IGameScreen-Objekt screen, der Spielwelt world und
 /// Objektinformationen info.
 /// </summary>
 public EdgeMovement(IScreen screen, World world, KnotRenderer knotRenderer, Vector3 position)
     : base(screen, DisplayLayer.None)
 {
     Screen = screen;
     World = world;
     KnotRenderer = knotRenderer;
 }
开发者ID:knot3,项目名称:knot3-code,代码行数:12,代码来源:EdgeMovement.cs

示例3: UserPreferencesPageViewModel

		public UserPreferencesPageViewModel (IScreen hostScreen, UserSettings userSettings)
		{
			HostScreen = hostScreen;

			var tempPrefChanged = this.WhenAnyValue (x => x.TemperaturePreference).StartWith (userSettings.TemperaturePreference);

			tempPrefChanged
				.Subscribe (x => userSettings.TemperaturePreference = x);
			
			tempPrefChanged
				.Select (x => x == TemperatureUnit.Celsius ? "C" : "F")
				.ToProperty (this, vm => vm.TempPreferenceLabel, out _TempPreferenceLabel);



//			var volumePrefChanged = this.WhenAnyValue (x => x.VolumePreference);
			
//			volumePrefChanged
//				.StartWith (userSettings.VolumePreference)
//				.Do (x => System.Diagnostics.Debug.WriteLine ("setting vol pref {0}", x))
//				.Subscribe (x => userSettings.VolumePreference = x);
//
//			var equipLossChanged = this.WhenAnyValue (x => x.EquipmentLossVolume);
//
//			equipLossChanged
//				.StartWith (userSettings.EquipmentLossVolume)
//				.Subscribe (x => userSettings.EquipmentLossVolume = x);
//
//			var trubLossChanged = this.WhenAnyValue (x => x.TrubLossVolume);
//
//			trubLossChanged
//				.StartWith (userSettings.TrubLossVolume)
//				.Subscribe (x => userSettings.TrubLossVolume = x);
		}
开发者ID:reactiveui-forks,项目名称:Time2Brew,代码行数:34,代码来源:UserPreferencesPageViewModel.cs

示例4: Pipe

        /// <summary>
        /// Erstellt ein neues Informationsobjekt für ein 3D-Modell, das eine Kante darstellt.
        /// [base="pipe1", Angles3.Zero, new Vector3 (10,10,10)]
        /// </summary>
        public Pipe(IScreen screen, IGrid grid, Knot knot, Edge edge, Node node1, Node node2)
            : base(screen: screen)
        {
            UniqueKey = edge.ToString ();

            // Weise Knoten und Kante zu
            Knot = knot;
            Edge = edge;
            Grid = grid;

            // Berechne die beiden Positionen, zwischen denen die Kante gezeichnet wird
            PositionFrom = node1;
            PositionTo = node2;

            // Kanten sind verschiebbar und auswählbar
            IsMovable = true;
            IsSelectable = true;

            // Berechne die Drehung
            Rotation += RotationMap [Edge.Direction];

            // Aktualisiere die Kategorie
            Coloring.OnColorChanged += UpdateCategory;
            IsSingleColored = true;

            incomplete = true;
        }
开发者ID:knot3,项目名称:knot3-code,代码行数:31,代码来源:Pipe.cs

示例5: PersonListViewModel

 public PersonListViewModel(IScreen hostScreen, IPersonRepository personRepository = null)
 {
     HostScreen = hostScreen;
     personRepository = personRepository ?? new PersonRepository();
     Persons = new ReactiveList<PersonItemViewModel>();
     NewPersonCommand = new ReactiveCommand(null);
     NewPersonCommand.RegisterAsyncAction(_ => { }).Subscribe(_ => HostScreen.Router.Navigate.Execute(new PersonAddViewModel(HostScreen)));
     RefreshCommand = new ReactiveCommand(null);
     var refresh = RefreshCommand.RegisterAsync<List<Person>>(_ => Observable.Start(() => personRepository.RetrievePersonsAsync().
                                                                                                           Result));
     refresh.Subscribe(list =>
     {
         using (Persons.SuppressChangeNotifications())
         {
             Persons.Clear();
             Persons.AddRange(personRepository.RetrievePersonsAsync().
                                               Result.Select(d => new PersonItemViewModel(d.FirstName,
                                                                      d.LastName,
                                                                      d.Age)));
         }
     });
     MessageBus.Current.Listen<Person>().
                Subscribe(p =>
                {
                    personRepository.AddPerson(p);
                    RefreshCommand.Execute(null);
                });
 }
开发者ID:jiravanet,项目名称:Prezentace-ReactiveUI,代码行数:28,代码来源:PersonListViewModel.cs

示例6: TextInputDialog

        /// <summary>
        /// Erstelle einen neuen TextInputDialog.
        /// </summary>
        public TextInputDialog(IScreen screen, DisplayLayer drawOrder, string title, string text, string inputText)
            : base(screen, drawOrder, title)
        {
            textItem = new TextItem (screen, drawOrder, String.Empty);

            Cancel = (time) => {
                Close (time);
            };
            Submit = (time) => {
                Close (time);
            };

            Bounds.Size = new ScreenPoint (screen, 0.5f, 0.3f);
            // Der Titel-Text ist mittig ausgerichtet
            AlignX = HorizontalAlignment.Center;
            menu = new Menu (Screen, Index + DisplayLayer.Menu);
            menu.Bounds = ContentBounds;
            menu.Bounds.Padding = new ScreenPoint (screen, 0.010f, 0.019f);
            menu.ItemAlignX = HorizontalAlignment.Left;
            menu.ItemAlignY = VerticalAlignment.Center;

            //die Texteingabe
            textInput = new InputItem (Screen, Index + DisplayLayer.MenuItem, text, inputText);
            menu.Add (textInput);
            menu.Add (textItem);
            textInput.IsEnabled = true;
            textInput.IsInputEnabled = true;
            textInput.NameWidth = 0.35f;
            textInput.ValueWidth = 0.65f;

            ValidKeys.AddRange (new Keys[] { Keys.Enter, Keys.Escape });
        }
开发者ID:knot3,项目名称:knot3-code,代码行数:35,代码来源:TextInputDialog.cs

示例7: TwoFactorViewModel

        public TwoFactorViewModel(IScreen host)
        {
            HostScreen = host;

            var codeHasBeenInput = this.WhenAny(x => x.Code, code => !string.IsNullOrWhiteSpace(code.Value));
            Submit = new ReactiveCommand(codeHasBeenInput);
        }
开发者ID:jugglingnutcase,项目名称:StarHub,代码行数:7,代码来源:TwoFactorViewModel.cs

示例8: AddScreen

        public void AddScreen(IScreen screen)
        {
            _screens.Add(screen);

            if (_screens.Count == 1)
                _activeScreen = screen;
        }
开发者ID:aevv,项目名称:Biscuit,代码行数:7,代码来源:ScreenManager.cs

示例9: HomeViewModel

        public HomeViewModel(ITelephonyService telephonyService = null, IScreen hostScreen = null)
        {
            TelephonyService = telephonyService ?? Locator.Current.GetService<ITelephonyService>();

            HostScreen = hostScreen ?? Locator.Current.GetService<IScreen>();

            var canComposeSMS = this.WhenAny(x => x.Recipient, x => !string.IsNullOrWhiteSpace(x.Value));
            ComposeSMS = ReactiveCommand.CreateAsyncTask(canComposeSMS,
                async _ => { await TelephonyService.ComposeSMS(Recipient); });
            ComposeSMS.ThrownExceptions.Subscribe(
                ex => UserError.Throw("Does this device have the capability to send SMS?", ex));

            var canComposeEmail = this.WhenAny(x => x.Recipient, x => !string.IsNullOrWhiteSpace(x.Value));
            ComposeEmail = ReactiveCommand.CreateAsyncTask(canComposeEmail, async _ =>
            {
                var email = new Email(Recipient);

                await TelephonyService.ComposeEmail(email);
            });
            ComposeEmail.ThrownExceptions.Subscribe(
                ex => UserError.Throw("The recipient is potentially not a well formed email address.", ex));

            var canMakePhoneCall = this.WhenAny(x => x.Recipient, x => !string.IsNullOrWhiteSpace(x.Value));
            MakePhoneCall = ReactiveCommand.CreateAsyncTask(canMakePhoneCall,
                async _ => { await TelephonyService.MakePhoneCall(Recipient); });
            MakePhoneCall.ThrownExceptions.Subscribe(
                ex => UserError.Throw("Does this device have the capability to make phone calls?", ex));

            var canMakeVideoCall = this.WhenAny(x => x.Recipient, x => !string.IsNullOrWhiteSpace(x.Value));
            MakeVideoCall = ReactiveCommand.CreateAsyncTask(canMakeVideoCall,
                async _ => { await TelephonyService.MakeVideoCall(Recipient); });
            MakeVideoCall.ThrownExceptions.Subscribe(
                ex => UserError.Throw("Does this device have the capability to make video calls?", ex));
        }
开发者ID:Jurabek,项目名称:telephony,代码行数:34,代码来源:HomeViewModel.cs

示例10: StoryTellerTabItem

        public StoryTellerTabItem(IScreen screen, IEventAggregator events)
        {
            _screen = screen;
            _item = new TabItem();

            Func<Action<IScreenConductor>, Action> sendMessage = a => () => events.SendMessage(a);

            _item.Header = new StackPanel().Horizontal()
                .Configure(x =>
                {
                    x.Height = 25;
                })
                .AddText(screen.Title, x => _label = x)
                .Add(new TabCloser(sendMessage(s => s.Close(screen))));

            _label.VerticalAlignment = VerticalAlignment.Center;
            _label.Margin = new Thickness(0, 0, 5, 0);

            _item.Content = new DockPanel().With(screen.View);
            _item.Tag = screen;

            // Sets up a context menu for each tab in the screen that can capture "Close"
            // messages
            _item.ContextMenu = new ContextMenu().Configure(o =>
            {
                o.AddItem("Close", sendMessage(s => s.Close(screen)));
                o.AddItem("Close All But This", sendMessage(s => s.CloseAllBut(screen)));
                o.AddItem("Close All", sendMessage(s => s.CloseAll()));
            });
        }
开发者ID:abombss,项目名称:storyteller,代码行数:30,代码来源:StoryTellerTabItem.cs

示例11: LoginRouteViewModel

 public LoginRouteViewModel(IScreen hostScreen)
 {
     HostScreen = hostScreen;
     var authentication = new Authentication();
     var canLogin = this.WhenAny(x => x.LoginName,
         x => x.Password,
         (l, p) => !String.IsNullOrWhiteSpace(l.Value) && !String.IsNullOrWhiteSpace(p.Value));
     LoginCommand = new ReactiveCommand(canLogin);
     var loggedIn = LoginCommand.RegisterAsync(_ => Observable.Start(() =>
     {
         var authenticationResult = authentication.AuthenticateAsync(LoginName,
             Password).
                                                   Result;
         return authenticationResult == AuthenticationResult.Authenticated
             ? "Přihlášen"
             : "Nepřihlášen";
     }));
     loggedIn.Subscribe(s =>
     {
         if (s == "Přihlášen")
             HostScreen.Router.Navigate.Execute(new PersonListViewModel(HostScreen));
     });
     message = new ObservableAsPropertyHelper<string>(loggedIn,
         s => raisePropertyChanged("Message"));
 }
开发者ID:jiravanet,项目名称:Prezentace-ReactiveUI,代码行数:25,代码来源:LoginRouteViewModel.cs

示例12: TextBox

 /// <summary>
 /// Erzeugt ein neues TextItem-Objekt und initialisiert dieses mit dem zugehörigen IGameScreen-Objekt.
 /// Zudem sind Angabe der Zeichenreihenfolge und der Zeichenkette, die angezeigt wird, für Pflicht.
 /// </summary>
 public TextBox(IScreen screen, DisplayLayer drawOrder, string text)
     : base(screen, drawOrder)
 {
     Text = text;
     State = WidgetState.None;
     spriteBatch = new SpriteBatch (screen.GraphicsDevice);
 }
开发者ID:knot3,项目名称:knot3-code,代码行数:11,代码来源:TextBox.cs

示例13: MainViewModel

        public MainViewModel(IScreen screen, ISettingsManager settingsManager, IVersionManager versionManager)
        {
            HostScreen = screen;

            Games = new GamesViewModel(Locator.Current);
            Downloads = new DownloadsViewModel(Locator.Current.GetService<IJobManager>());
            Messsages = new MessagesViewModel(Locator.Current.GetService<IDatabaseManager>(), Locator.Current.GetService<IMessageManager>());
            GotoSettings = ReactiveCommand.CreateAsyncObservable(_ => screen.Router.Navigate.ExecuteAsync(new SettingsViewModel(screen, settingsManager, versionManager, Locator.Current.GetService<IGameManager>())));

            // login status
            settingsManager.WhenAnyValue(sm => sm.AuthenticatedUser)
                .Select(u => u == null ? "Not logged." : $"Logged as {u.Name}")
                .ToProperty(this, x => x.LoginStatus, out _loginStatus);

            // show notice when new version arrives but hide when button was clicked
            versionManager.NewVersionAvailable
                .Where(release => release != null)
                .Subscribe(newRelease => {
                    ShowUpdateNotice = true;
                });
            CloseUpdateNotice.Subscribe(_ => {
                ShowUpdateNotice = false;
            });

            // restart button
            RestartApp.Subscribe(_ => { UpdateManager.RestartApp(); });
        }
开发者ID:freezy,项目名称:vpdb-agent,代码行数:27,代码来源:MainViewModel.cs

示例14: GetQualifiedViewModelName

 /// <summary>
 /// Gets the fully qualified name of a ViewModel. Just adds the AssemblyQualifiedName to the <see cref="GetViewModelName"/>.
 /// </summary>
 /// <param name="screen">The screen</param>
 /// <param name="targetPostFix">Either <see cref="HomePostFix"/> or <see cref="SinglePostFix"/></param>
 /// <param name="viewModelPostFix">The <see cref="ViewModelPostFix"/></param>
 /// <returns>The fully qualified ViewModel-Name</returns>
 private static string GetQualifiedViewModelName(IScreen screen, string targetPostFix, string viewModelPostFix)
 {
     string qualifiedName = screen.GetType().AssemblyQualifiedName;
     return qualifiedName.Replace(
         screen.GetType().Name,
         GetViewModelName(screen, targetPostFix, viewModelPostFix));
 }
开发者ID:Slesa,项目名称:Playground,代码行数:14,代码来源:NamingConventions.cs

示例15: Button

 /// <summary>
 /// Erzeugt ein neues MenuButton-Objekt und initialisiert dieses mit dem zugehörigen IGameScreen-Objekt.
 /// Zudem sind Angabe der Zeichenreihenfolge, einer Zeichenkette für den Namen der Schaltfläche
 /// und der Aktion, welche bei einem Klick ausgeführt wird Pflicht.
 /// </summary>
 public Button(IScreen screen, DisplayLayer drawOrder, string name, Action<GameTime> onClick)
     : base(screen, drawOrder)
 {
     this.name = name;
     OnClick = onClick;
     spriteBatch = new SpriteBatch (screen.GraphicsDevice);
 }
开发者ID:knot3,项目名称:knot3-code,代码行数:12,代码来源:Button.cs


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