public void SetBarAndStyle()
        {
            if (DeviceInfoManager.GetOsVersion() > 15063)
            {
                if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.Xaml.Media.XamlCompositionBrushBase"))
                {
                    Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush();
                    myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop;
                    myBrush.FallbackColor    = Colors.Transparent;
                    myBrush.TintColor        = Color.FromArgb(255, 15, 15, 15);
                    myBrush.TintOpacity      = 0.3;

                    SplitViewPane.Background = myBrush;
                    BarGrid.Background       = myBrush;

                    Style buttonReveal = (Style)Application.Current.Resources["ButtonRevealStyle"];
                    Style itemReveal   = (Style)Application.Current.Resources["NavMenuItemRevealStyle"];

                    PaneOpenButton.Style = buttonReveal;
                    NavMenuPrimaryListView.ItemContainerStyle   = itemReveal;
                    NavMenuSecondaryListView.ItemContainerStyle = itemReveal;
                }
            }

            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
            ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;

            titleBar.ButtonBackgroundColor         = Colors.Transparent;
            titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
            titleBar.ButtonForegroundColor         = Colors.White;
            titleBar.ButtonHoverBackgroundColor    = Colors.Gray;
        }
        /// <summary>
        /// 删除项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ItemDel_Click(object sender, EventArgs e)
        {
            DeviceInfo _ItemInfo = null;

            if (this._RecordListView.SelectedObjects != null && this._RecordListView.SelectedObjects.Count > 0)
            {
                _ItemInfo = (DeviceInfo)this._RecordListView.SelectedObjects[0];
            }
            else
            {
                MessageBox.Show("请选中项后再试!");
            }

            ConfirmFrm confirm = new ConfirmFrm("提示", "您确定需要删除此选中项?", "确定", "取消", 3);

            if (confirm.ShowDialog() == DialogResult.OK)
            {
                //1.调用bll,从模块对应的权限列表中移除
                DeviceInfoManager manager = new DeviceInfoManager();
                if (manager.Delete(_ItemInfo.DeviceID))
                {
                    RecordList.Remove(_ItemInfo);
                    //从列表中移除

                    //2.从列表中移除
                    this._RecordListView.RemoveObject(_ItemInfo);//将原生从列表中移除
                }
                else
                {
                    MessageBox.Show("操作失败!");
                }
            }
        }
Beispiel #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (DeviceInfoManager.GetOsVersion() > 15063)
            {
                Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush();
                myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop;
                myBrush.FallbackColor    = Colors.Transparent;
                myBrush.TintColor        = Color.FromArgb(255, 15, 15, 15);
                myBrush.TintOpacity      = 0.3;

                TitleGrid.Background    = myBrush;
                CreatureGrid.Background = myBrush;

                //Style style = (Style)Application.Current.Resources["GridViewItemRevealStyle"];
            }
        }
Beispiel #4
0
        /// <summary>
        /// Method to initialize network connection, configuration and deviceinfomanager class
        /// </summary>
        /// <param name="ipAddress">IPAddress value</param>
        /// <param name="port">Port value</param>
        /// <param name="connectionType">DeviceConnectionType</param>
        protected void Initialize(string ipAddress, string port, DeviceConnectionType connectionType)
        {
            try
            {
                nc = new NetworkConnection();

                nc.DeviceSettings.IPaddress = ipAddress;
                nc.DeviceSettings.Port = port;
                nc.DeviceSettings.ConnectionType = connectionType;
                nc.ReceiveTimeout = 1200000;
                nc.SendTimeout = 600000;

                Logger.Info("Starting Wait Connection");

                if (WaitForConnection(ipAddress, Convert.ToInt16(port), 15, 10))
                {
                    nc.OpenConnection();
                    Logger.Info(nc.IsOpen.ToString() + nc.DeviceSettings.Port + nc.DeviceSettings.IPaddress);

                    ncm = new NetworkConfigurationManager(nc);
                    Logger.Info(ncm.RetrieveEthernetNetworkSettings().IPAddress.ToString() + ncm.RetrieveEthernetNetworkSettings().Port.ToString());

                    dim = new DeviceInfoManager(nc);
                    Logger.Info("SDK: Initialize success for IP: " + ipAddress + " and PORT: " + port);
                }
                else
                {
                    throw new Exception("SDK: Failed to initialize network connection. Socket unavailable");
                }
            }
            catch (IXMSDKException ex)
            {
                Logger.Error(ex, "SDK: SDKException");
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "SDK: Failed to initialize methods for sdk for IP: " + ipAddress + " and PORT: " + port);
                throw;
            }
        }
Beispiel #5
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (DeviceInfoManager.GetOsVersion() > 15063)
            {
                Windows.UI.Xaml.Media.AcrylicBrush myBrush = new Windows.UI.Xaml.Media.AcrylicBrush();
                myBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop;
                myBrush.FallbackColor    = Colors.Transparent;
                myBrush.TintColor        = Color.FromArgb(255, 15, 15, 15);
                myBrush.TintOpacity      = 0.3;

                AboutGrid.Background = myBrush;

                Color brush = (Color)Application.Current.Resources["SystemAccentColor"];
                Windows.UI.Xaml.Media.AcrylicBrush appInfoBrush = new Windows.UI.Xaml.Media.AcrylicBrush();
                appInfoBrush.BackgroundSource = Windows.UI.Xaml.Media.AcrylicBackgroundSource.HostBackdrop;
                appInfoBrush.FallbackColor    = Colors.Transparent;
                appInfoBrush.TintColor        = brush;
                appInfoBrush.TintOpacity      = 0.6;

                AppInfoGrid.Background = appInfoBrush;
                TitleGrid.Background   = appInfoBrush;
            }
        }