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

C# IDataService类代码示例

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

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



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


示例16: BasePlaylistableViewModel

 public BasePlaylistableViewModel(IDataService dataService, IAccountService accountService, IDialogService dialogService, IResourceService resourceService)
 {
     this.DataService = dataService;
     this.AccountService = accountService;
     this.DialogService = dialogService;
     this.ResourceService = resourceService;
 }
开发者ID:uwe-e,项目名称:BSE.Tunes,代码行数:7,代码来源:BasePlaylistableViewModel.cs


示例17: TaskViewModel

 /// <summary>
 /// Initializes a new instance of the TaskViewModel class.
 /// </summary>
 public TaskViewModel(Task model, string listId, IDataService dataService, INavigationService navigationService, IDialogService dialogService)
     : base(dataService, navigationService, dialogService)
 {
     _model = model;
     _listId = listId;
     update();
 }
开发者ID:roosi,项目名称:done,代码行数:10,代码来源:TaskViewModel.cs


示例18: OrderBy

        /// <summary>Sorts a query like a SQL ORDER BY clause does.</summary>
        /// <param name="service">Service with data and configuration.</param>
        /// <param name="source">Original source for query.</param>
        /// <param name="orderingInfo">Ordering definition to compose.</param>
        /// <returns>The composed query.</returns>
        internal static IQueryable OrderBy(IDataService service, IQueryable source, OrderingInfo orderingInfo)
        {
            Debug.Assert(service != null, "service != null");
            Debug.Assert(source != null, "source != null");
            Debug.Assert(orderingInfo != null, "orderingInfo != null");

            Expression queryExpr = source.Expression;
            string methodAsc = "OrderBy";
            string methodDesc = "OrderByDescending";
            foreach (OrderingExpression o in orderingInfo.OrderingExpressions)
            {
                LambdaExpression selectorLambda = (LambdaExpression)o.Expression;
                Type selectorType = selectorLambda.Body.Type;
                service.Provider.CheckIfOrderedType(selectorType);

                queryExpr = Expression.Call(
                    typeof(Queryable),
                    o.IsAscending ? methodAsc : methodDesc,
                    new Type[] { source.ElementType, selectorType },
                    queryExpr,
                    Expression.Quote(selectorLambda));

                methodAsc = "ThenBy";
                methodDesc = "ThenByDescending";
            }

            return source.Provider.CreateQuery(queryExpr);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:33,代码来源:RequestQueryParser.cs


示例19: RoomSearchViewModel

        public RoomSearchViewModel(IDataService dataService, ProgressViewModel progressViewModel)
        {
            _dataService = dataService;
            _progressViewModel = progressViewModel;

            SearchCommand = new RelayCommand(PerformSearch,
                               () => SelectedRooms != null && SelectedRooms.Count > 0);

            ResetData();

            SelectedDate = DateTime.Today;
            SelectedStartTime = DateTime.Now;

            var today = Today;
            if (DateTime.Now > today.AddHours(16))
            {
                SelectedEndTime = DateTime.Now.AddHours(1);
            }
            else if (DateTime.Now >= today.AddHours(12))
            {
                SelectedEndTime = today.AddHours(16);
            }
            else
            {
                SelectedEndTime = today.AddHours(12);
            }
            SelectedExtras = RoomExtras.None;

            _progressViewModel.DataReloaded += OnDataReloaded;
        }
开发者ID:Danielku15,项目名称:FhvRoomSearch,代码行数:30,代码来源:RoomSearchViewModel.cs


示例20: CatalogueController

 public CatalogueController(IDataService dataService, ISocialService socialService, IMailService mailService, IConvertService convertService, AuthorizationRoot authorizationRoot)
     : base(dataService, authorizationRoot)
 {
     _socialService = socialService;
     _mailService = mailService;
     _convertService = convertService;
 }
开发者ID:avgx,项目名称:knigoskop,代码行数:7,代码来源:CatalogueController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IDataSet类代码示例发布时间:2022-05-24
下一篇:
C# IDataRepository类代码示例发布时间: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