本文整理汇总了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();
}
示例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();
}
});
}
示例3: MainViewModel
public MainViewModel(
IViewModelCreatorService viewModelCreatorService,
IDataService dataService)
{
_viewModelCreatorService = viewModelCreatorService;
_dataService = dataService;
}
示例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();
}
});
}
示例5: WarehouseItemsViewModel
public WarehouseItemsViewModel(
IDataService dataService,
IViewModelCreatorService viewModelCreatorService)
{
_dataService = dataService;
_viewModelCreatorService = viewModelCreatorService;
}
示例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;
});
}
示例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;
}
}
}
}
示例8: ArtistViewModel
public ArtistViewModel(IDataService dataService, INavigationService navigationService)
{
_dataService = dataService;
_navigationService = navigationService;
Task.Run(() => Initialize());
}
示例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;
}
示例10: GroupsViewModel
public GroupsViewModel(INavigationService navigationService)
{
this.dataService = SimpleIoc.Default.GetInstance<IDataService>();
this.AllGroups = new ObservableCollection<Groups>();
GetAllGroupsAsync();
this.navigationService = navigationService;
}
示例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;
}
});
}
示例12: ContactListViewModel
public ContactListViewModel( IDataService pDataService )
{
_dataService = pDataService;
this.SmallTitle = "CONTACT TRACKER";
this.BigTitle = "contacts";
}
示例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();
}
示例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();
}
}
示例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();
});
}