aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/OS/IOperationSystemManager.cs
blob: 4faef33f901e1b2447f01c667f7dc5e318a12f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.PPC.Common.OS
{
    /// <summary>
    /// Represents a windows license activation manager.
    /// </summary>
    public interface IOperationSystemManager
    {
        /// <summary>
        /// Determines whether the OS is activated.
        /// </summary>
        /// <returns></returns>
        Task<bool> IsActivated();

        /// <summary>
        /// Activates the OS using the specified activation key.
        /// </summary>
        /// <param name="activationKey">The activation key.</param>
        /// <returns></returns>
        Task Activate(String activationKey);

        /// <summary>
        /// Deactivates the OS license.
        /// </summary>
        /// <returns></returns>
        Task Deactivate();

        /// <summary>
        /// Gets the available time zones.
        /// </summary>
        /// <returns></returns>
        ReadOnlyCollection<TimeZoneInfo> GetAvailableTimeZones();

        /// <summary>
        /// Changes the operation system time zone.
        /// </summary>
        /// <param name="timeZone">The time zone.</param>
        /// <returns></returns>
        Task ChangeTimeZone(TimeZoneInfo timeZone);

        /// <summary>
        /// Gets the machine unique identifier.
        /// </summary>
        /// <returns></returns>
        Task<String> GetDeviceId();

        /// <summary>
        /// Gets the machine host name.
        /// </summary>
        /// <returns></returns>
        Task<String> GetDeviceName();

        /// <summary>
        /// Sets the device host name.
        /// </summary>
        /// <returns></returns>
        Task SetDeviceName(String name);

        /// <summary>
        /// Restarts the system.
        /// </summary>
        /// <returns></returns>
        void Restart();

        /// <summary>
        /// Shutdown the system.
        /// </summary>
        /// <returns></returns>
        void Shutdown();

        /// <summary>
        /// Opens the operating system shell (explorer).
        /// </summary>
        void OpenShell();
    }
}
ass="c1">/// <summary> /// Gets or sets the scroll viewer. /// </summary> public LightTouchScrollViewer ScrollViewer { get { return (LightTouchScrollViewer)GetValue(ScrollViewerProperty); } set { SetValue(ScrollViewerProperty, value); } } public static readonly DependencyProperty ScrollViewerProperty = DependencyProperty.Register("ScrollViewer", typeof(LightTouchScrollViewer), typeof(TouchNativeListBox), new PropertyMetadata(null)); public override void OnApplyTemplate() { base.OnApplyTemplate(); ScrollViewer = GetTemplateChild("PART_ScrollViewer") as LightTouchScrollViewer; } protected override void OnMouseUp(MouseButtonEventArgs e) { if (ScrollViewer.IsAfterScrolling) return; if (e.ChangedButton == MouseButton.Left) { DependencyObject obj = this.ContainerFromElement((Visual)e.OriginalSource); if (obj != null) { FrameworkElement element = obj as FrameworkElement; if (element != null) { if (String.IsNullOrWhiteSpace(SelectedValuePath)) { ListBoxItem item = element as ListBoxItem; if (item != null) { this.SelectedItem = item.DataContext; } } else { object context = element.DataContext; if (context != null) { SelectedValue = context.GetPropertyValueByPath(SelectedValuePath); } } } } } } protected override void OnPreviewMouseDown(MouseButtonEventArgs e) { if (PreventTouchDownSelect) { e.Handled = true; } } static TouchNativeListBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNativeListBox), new FrameworkPropertyMetadata(typeof(TouchNativeListBox))); } } }