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


C# IDataService类代码示例

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


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

示例1: ViewModel

        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public ViewModel(IDataService dataService)
        {
            _dataService = dataService;

            monitorServersThread = new Thread(monitorServersThreadRun);
            monitorServersThread.Start();
        }
开发者ID:BrianGoff,项目名称:BITS,代码行数:10,代码来源:ViewModel.cs

示例2: RegisterViewModel

        public RegisterViewModel(INavigationService navigationService)
        {
            this.User = new User();
            this.navigationService = navigationService;
            this.dataService = SimpleIoc.Default.GetInstance<IDataService>();

            this.BackCommand = new RelayCommand<string>((s) =>
            {
                this.navigationService.GoBack();
            });

            this.RegisterCommand = new RelayCommand(async() =>
            {
                if (this.User.Password == this.User.RepeatedPassword)
                {
                    await dataService.CreateUser(this.User.Username, this.User.Password, this.User.Email);

                    //if registration is faild
                    if (((App)App.Current).AuthenticatedUser != null && ((App)App.Current).AuthenticatedUser.IsAuthenticated)
                    {
                        this.navigationService.Navigate(ViewsType.Groups);
                    }
                }
                else
                {
                    new MessageDialog("Двете пароли не съвпадат").ShowAsync();
                }
            });
        }
开发者ID:naturalna,项目名称:TopTen,代码行数:29,代码来源:RegisterViewModel.cs

示例3: MainViewModel

 public MainViewModel(
     IViewModelCreatorService viewModelCreatorService,
     IDataService dataService)
 {
     _viewModelCreatorService = viewModelCreatorService;
     _dataService = dataService;
 }
开发者ID:LogoFX,项目名称:tools,代码行数:7,代码来源:MainViewModel.cs

示例4: PlayerManager

 public PlayerManager(IDataService dataService, IAccountService accountService, IPlayerService playerService, IDialogService dialogservice, IResourceService resourceService)
 {
     this.m_dataService = dataService;
     this.m_accountService = accountService;
     this.PlayerService = playerService;
     this.m_dialogService = dialogservice;
     this.m_resourceService = resourceService;
     Messenger.Default.Register<MediaOpenedMessage>(this, message =>
     {
         this.OnMediaOpened();
     });
     Messenger.Default.Register<MediaEndedMessage>(this, message =>
     {
         this.OnMediaEnded();
     });
     Messenger.Default.Register<MediaNextPressedMessage>(this, message =>
     {
         if (this.CanExecuteNextTrack())
         {
             this.ExecuteNextTrack();
         }
     });
     Messenger.Default.Register<MediaPreviousPressedMessage>(this, message =>
     {
         if (this.CanExecutePreviousTrack())
         {
             this.ExecutePreviousTrack();
         }
     });
 }
开发者ID:uwe-e,项目名称:BSE.Tunes,代码行数:30,代码来源:PlayerManager.cs

示例5: WarehouseItemsViewModel

 public WarehouseItemsViewModel(
     IDataService dataService,
     IViewModelCreatorService viewModelCreatorService)
 {
     _dataService = dataService;
     _viewModelCreatorService = viewModelCreatorService;
 }
开发者ID:LogoFX,项目名称:Samples.Specifications,代码行数:7,代码来源:WarehouseItemsViewModel.cs

示例6: CustomerDetailViewModel

        public CustomerDetailViewModel(Account account, Page currentPage)
        {
            if (account == null)
            {
                Account = new Account();
                Account.Industry = Account.IndustryTypes[0];
                Account.OpportunityStage = Account.OpportunityStages[0];

                this.Title = "New Account";
            }
            else
            {
                Account = account;
                this.Title = "Account";
            }

            _CurrentPage = currentPage;

            this.Icon = "account.png";

            _DataClient = DependencyService.Get<IDataService>();
            _GeoCodingService = DependencyService.Get<IGeoCodingService>();

            MessagingCenter.Subscribe<Account>(this, MessagingServiceConstants.ACCOUNT, (Account) =>
                {
                    IsInitialized = false;
                });
        }
开发者ID:XnainA,项目名称:app-crm,代码行数:28,代码来源:CustomerDetailViewModel.cs

示例7: FireNotification

        /// <summary>Fires the notification for a single action.</summary>
        /// <param name="service">Service on which methods should be invoked.</param>
        /// <param name="target">Object to be tracked.</param>
        /// <param name="container">Container in which object is changed.</param>
        /// <param name="action">Action affecting target.</param>
        internal static void FireNotification(IDataService service, object target, ResourceSetWrapper container, UpdateOperations action)
        {
            Debug.Assert(service != null, "service != null");
            AssertActionValues(target, container);

            MethodInfo[] methods = container.ChangeInterceptors;
            if (methods != null)
            {
                object[] parameters = new object[2];
                parameters[0] = target;
                parameters[1] = action;
                for (int i = 0; i < methods.Length; i++)
                {
                    try
                    {
                        methods[i].Invoke(service.Instance, parameters);
                    }
                    catch (TargetInvocationException exception)
                    {
                        ErrorHandler.HandleTargetInvocationException(exception);
                        throw;
                    }
                }
            }
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:30,代码来源:UpdateTracker.cs

示例8: ArtistViewModel

        public ArtistViewModel(IDataService dataService, INavigationService navigationService)
        {
            _dataService = dataService;
            _navigationService = navigationService;

            Task.Run(() => Initialize());
        }
开发者ID:dupuyjs,项目名称:rimshot,代码行数:7,代码来源:ArtistViewModel.cs

示例9: SearchResultPageViewModel

        public SearchResultPageViewModel(IDataService dataService, INavigationService navigationService, IResourceService resourceService, IDialogService dialogService)
        {
            this.m_dataService = dataService;
            this.m_navigationService = navigationService;
            this.m_resourceService = resourceService;
			this.m_dialogservice = dialogService;
        }
开发者ID:uwe-e,项目名称:BSE.Tunes,代码行数:7,代码来源:SearchResultPageViewModel.cs

示例10: GroupsViewModel

 public GroupsViewModel(INavigationService navigationService)
 {
     this.dataService = SimpleIoc.Default.GetInstance<IDataService>();
     this.AllGroups = new ObservableCollection<Groups>();
     GetAllGroupsAsync();
     this.navigationService = navigationService;
 }
开发者ID:naturalna,项目名称:TopTen,代码行数:7,代码来源:GroupsViewModel.cs

示例11: PlayerManager

 public PlayerManager(IDataService dataService, IAuthenticationService accountService, IPlayerService playerService, IDialogService dialogservice, IResourceService resourceService)
 {
     this.m_dataService = dataService;
     this.m_accountService = accountService;
     this.PlayerService = playerService;
     this.m_dialogService = dialogservice;
     this.m_resourceService = resourceService;
     Messenger.Default.Register<MediaStateChangedArgs>(this, args =>
     {
         switch (args.MediaState)
         {
             case MediaState.Opened:
                 OnMediaOpened();
                 break;
             case MediaState.Ended:
                 this.OnMediaEnded();
                 break;
             case MediaState.NextRequested:
                 ExecuteNextTrack();
                 break;
             case MediaState.PreviousRequested:
                 ExecutePreviousTrack();
                 break;
             case MediaState.DownloadCompleted:
                 PrepareNextTrack();
                 break;
         }
     });
 }
开发者ID:uwe-e,项目名称:BSE.Tunes,代码行数:29,代码来源:PlayerManager.cs

示例12: ContactListViewModel

        public ContactListViewModel( IDataService pDataService )
        {
            _dataService = pDataService;

            this.SmallTitle = "CONTACT TRACKER";
            this.BigTitle = "contacts";
        }
开发者ID:pengo98,项目名称:SydMobNet,代码行数:7,代码来源:ContactListViewModel.cs

示例13: HandleBatchProcessException

        /// <summary>Handles an exception when processing a batch response.</summary>
        /// <param name='service'>Data service doing the processing.</param>
        /// <param name="host">host to which we need to write the exception message</param>
        /// <param name='exception'>Exception thrown.</param>
        /// <param name='writer'>Output writer for the batch.</param>
        internal static void HandleBatchProcessException(IDataService service, DataServiceHostWrapper host, Exception exception, StreamWriter writer)
        {
            Debug.Assert(service != null, "service != null");
            Debug.Assert(host != null, "host != null");
            Debug.Assert(exception != null, "exception != null");
            Debug.Assert(writer != null, "writer != null");
            Debug.Assert(service.Configuration != null, "service.Configuration != null");
            Debug.Assert(WebUtil.IsCatchableExceptionType(exception), "WebUtil.IsCatchableExceptionType(exception)");

            string contentType;
            Encoding encoding;
            TryGetResponseFormatForError(host, out contentType, out encoding);

            HandleExceptionArgs args = new HandleExceptionArgs(exception, false, contentType, service.Configuration.UseVerboseErrors);
            service.InternalHandleException(args);
            host.ResponseVersion = XmlConstants.DataServiceVersion1Dot0 + ";";
            host.ProcessException(args);

            writer.Flush();
            Action<Stream> errorWriter = ProcessBenignException(exception, service);
            if (errorWriter == null)
            {
                errorWriter = CreateErrorSerializer(args, encoding);
            }

            errorWriter(writer.BaseStream);
            writer.WriteLine();
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:33,代码来源:ErrorHandler.cs

示例14: WriteRequest

        /// <summary>Writes the Service Document to the output stream.</summary>
        /// <param name="service">Data service instance.</param>
        internal override void WriteRequest(IDataService service)
        {
            try
            {
                this.Writer.WriteStartElement(XmlConstants.AtomPublishingServiceElementName, XmlConstants.AppNamespace);
                this.IncludeCommonNamespaces();
                this.Writer.WriteStartElement("", XmlConstants.AtomPublishingWorkspaceElementName, XmlConstants.AppNamespace);

                this.Writer.WriteStartElement(XmlConstants.AtomTitleElementName, XmlConstants.AtomNamespace);
                this.Writer.WriteString(XmlConstants.AtomPublishingWorkspaceDefaultValue);
                this.Writer.WriteEndElement();

                foreach (ResourceSetWrapper container in this.Provider.ResourceSets)
                {
                    this.Writer.WriteStartElement("", XmlConstants.AtomPublishingCollectionElementName, XmlConstants.AppNamespace);
                    this.Writer.WriteAttributeString(XmlConstants.AtomHRefAttributeName, container.Name);

                    this.Writer.WriteStartElement(XmlConstants.AtomTitleElementName, XmlConstants.AtomNamespace);
                    this.Writer.WriteString(container.Name);
                    this.Writer.WriteEndElement();  // Close 'title' element.

                    this.Writer.WriteEndElement();  // Close 'collection' element.
                }

                this.Writer.WriteEndElement();  // Close 'workspace' element.
                this.Writer.WriteEndElement();  // Close 'service' element.
            }
            finally
            {
                this.Writer.Close();
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:34,代码来源:AtomServiceDocumentSerializer.cs

示例15: OrdersViewModel

        public OrdersViewModel(Account account)
        {
            Account = account;

            _Orders = new List<Order>();

            _DataClient = DependencyService.Get<IDataService>();

            OrderGroups = new ObservableCollection<Grouping<Order, string>>();

            MessagingCenter.Subscribe<Order>(this, MessagingServiceConstants.SAVE_ORDER, order =>
                {
                    var index = _Orders.IndexOf(order);
                    if (index >= 0)
                    {
                        _Orders[index] = order;
                    }
                    else
                    {
                        _Orders.Add(order);
                    }

                    GroupOrders();
                });
        }
开发者ID:xamarin,项目名称:app-crm,代码行数:25,代码来源:OrdersViewModel.cs


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