예제 #1
0
        public ViewModel()
        {
            cFExRepository = new CFExRepository();
            cFExRepository.progressChanged += ProgressChanged;
            visitorCollection         = new ObservableCollection <Visitor>();
            displaySettingCollection  = cFExRepository.DisplaySettingCollection;
            dsColumnSettingCollection = cFExRepository.DsColumnSettingCollection;
            selectedSetting           = displaySettingCollection.Where(s => s.IsSelected == true).FirstOrDefault();
            selectedCollumnSetting    = dsColumnSettingCollection.Where(s => s.IsSelected == true).FirstOrDefault();

            addDataFromFileToDatabase = new RelayCommand(c =>
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                _ProgressBar = new Progress_Bar {
                    Visible = true, Progress = 10, Status = "Start"
                };
                if (openFileDialog.ShowDialog() == true)
                {
                    Task.Factory.StartNew(() =>
                    {
                        cFExRepository.initRepositoryFromFile(openFileDialog.FileName);
                        visitorCollection     = cFExRepository.VisitorCollection;
                        _ProgressBar.Status   = "All data added to database";
                        _ProgressBar.Progress = 0;
                        Thread.Sleep(3000);
                        _ProgressBar.Visible = false;
                    });
                }
            });
        }
예제 #2
0
        public void SetDisplaySetting(DisplaySetting setting)
        {
            this.DisplaySetting = setting;
            if (setting != DisplaySetting.Everything)
            {
                lbCurrentResult.Text = "";
                rtResults.Text       = "";
                lbResults.Text       = "";
                dgResultList.Rows.Clear();
            }
            dgResultList.Rows.Clear();
            using (SVPEntitiesContainer context = new SVPEntitiesContainer())
            {
                foreach (Sequence result in sequenceList)
                {
                    Sequence seq = context.Sequences.Find(result.Id);
                    switch (DisplaySetting)
                    {
                    case DisplaySetting.Everything:
                        dgResultList.Rows.Add(seq.Member.ToString(), seq.Shots.Sum(x => x.Value).ToString(), seq.Profile);
                        break;

                    case DisplaySetting.EverythingAnonym:
                        dgResultList.Rows.Add(SVP.Properties.Settings.Default.DefaultName, seq.Shots.Sum(x => x.Value).ToString(), seq.Profile);
                        break;
                    }
                }
            }
        }
예제 #3
0
파일: LogView.cs 프로젝트: jjeffery/Cesto
        public LogView()
        {
            InitializeComponent();
            var adapter = new VirtualDataGridViewAdapter<LogUI.Event>(dataGridView)
                .DefineCellValue(timestampColumn, l => l.Timestamp)
                .DefineCellValue(levelColumn, l => l.Level.ToString())
                .DefineCellValue(loggerColumn, l => l.Logger)
                .DefineCellValue(messageColumn, l => l.Message)
                .WithDisplaySettings(_displaySettings);

            adapter.DataSource = _dataSource;
            adapter.ListChanged += ListChanged;

            _showDebugSetting = _displaySettings.BooleanSetting("ShowDebug");
            showDebugCheckBox.Checked = _showDebugSetting.GetValue();

            _showLoggerSetting = _displaySettings.BooleanSetting("ShowLogger");
            showLoggerCheckBox.Checked = _showLoggerSetting.GetValue();
            loggerColumn.Visible = showLoggerCheckBox.Checked;

            SetFilter();

            dataGridView.Disposed += delegate {
                adapter.DataSource = null;
                adapter.ListChanged -= ListChanged;
            };
        }
예제 #4
0
 public DisplaySetting AddOrUpdateDisplaySetting(DisplaySetting displaySetting)
 {
     context.DisplaySettings.AddOrUpdate(displaySetting);
     context.SaveChanges();
     return(context.DisplaySettings.Where(s =>
                                          s.Name == displaySetting.Name &&
                                          s.Intendant == displaySetting.Intendant).FirstOrDefault());
 }
예제 #5
0
 public static IPediaRenderer GetDefaultRenderer(DisplaySetting setting)
 {
     if (!defaultRenderers.TryGetValue(setting, out var renderer))
     {
         renderer = new DefaultPediaRenderer(setting);
         defaultRenderers.Add(setting, renderer);
     }
     return(renderer);
 }
    // Start is called before the first frame update
    void Start()
    {
        // get useful classes
        tF = GetComponent <Transform>();
        dS = GameObject.Find("Setting").GetComponent <DisplaySetting>();
        bP = GetComponent <BodyProperty>();
        bO = GetComponent <BodyOrbit>();
        if (bO.centralBody != null)
        {
            cBM = bO.centralBody.GetComponent <BodyMotion>();
        }

        // set display size of body
        float d = (float)(bP.D * dS.scaleD);

        tF.localScale = new Vector3(d, d, d);
        MeshRenderer mr = GetComponent <MeshRenderer>();

        mr.material.color = Color.white;

        InitOrbit();

        /*
         * // set the initial position of body,
         * // initial position is relative to the central body
         * pos[0] = bO.R;
         * SetPosition();
         *
         * // set the initial velocity of revolution
         * // initial velocity if relative to the central body
         * double pi = Math.PI;
         * vel[1] = Math.Sin(pi * bO.angle / 180) * bO.V;
         * vel[2] = Math.Cos(pi * bO.angle / 180) * bO.V;
         */

        t0   = Time.time;
        minZ = bO.R;

        // init trajectory and line drawing setting
        if (trajEnable)
        {
            AddTrajectory();
            line               = gameObject.GetComponent <LineRenderer>();
            line.material      = new Material(Shader.Find("Sprites/Default"));
            line.positionCount = 0;
            line.startWidth    = (float)(dS.scaleD * bP.D * 1.05); // self 1.05 times;
            //line.startWidth = (float)(cBM.bP.D * dS.scaleD * 0.1); // 1/10 of central body size;
            line.endWidth      = 0.01f;
            line.startColor    = Color.red;
            line.endColor      = Color.red;
            line.useWorldSpace = true;
        }

        Debug.Log(this.name + " size=" + tF.localScale + " pos=" + tF.position);
    }
        public void HeightTest()
        {
            var target = new DisplaySetting();

            int expected = 513;
            int actual;
            target.Height = expected;
            actual = target.Height;

            Assert.AreEqual(expected, actual);
        }
        public void FullscreenTest()
        {
            var target = new DisplaySetting();

            bool expected = true;
            bool actual;
            target.Fullscreen = expected;
            actual = target.Fullscreen;

            Assert.AreEqual(expected, actual);
        }
        public void CloseAfterPlayTest()
        {
            var target = new DisplaySetting();

            bool expected = true;
            bool actual;
            target.CloseAfterPlay = expected;
            actual = target.CloseAfterPlay;

            Assert.AreEqual(expected, actual);
        }
예제 #10
0
 public bool delDisplaySetting(DisplaySetting ds)
 {
     try
     {
         context.DisplaySettings.Remove(ds);
         context.SaveChanges();
         displaySettingCollection.Remove(ds);
     }
     catch { return(false); }
     return(true);
 }
        public DisplaySettingDTO AddOrUpdate(DisplaySettingDTO displaySettingDTO)
        {
            DisplaySetting displaySetting = mapper.Map <DisplaySetting>(displaySettingDTO);

            if (displaySetting != null)
            {
                displaySettingDTO = mapper.Map <DisplaySettingDTO>
                                        (displaySettingRepository.AddOrUpdateDisplaySetting(displaySetting));
            }
            return(displaySettingDTO);
        }
        public void WidthTest()
        {
            var target = new DisplaySetting();

            int expected = -1;
            int actual;
            target.Width = expected;
            actual = target.Width;

            Assert.AreEqual(expected, actual);
        }
        public void EmbeddedTest()
        {
            var target = new DisplaySetting();

            bool expected = true;
            bool actual;
            target.Embedded = expected;
            actual = target.Embedded;

            Assert.AreEqual(expected, actual);
        }
예제 #14
0
        public void HeightTest()
        {
            var target = new DisplaySetting();

            int expected = 513;
            int actual;

            target.Height = expected;
            actual        = target.Height;

            Assert.AreEqual(expected, actual);
        }
예제 #15
0
        public void FullscreenTest()
        {
            var target = new DisplaySetting();

            bool expected = true;
            bool actual;

            target.Fullscreen = expected;
            actual            = target.Fullscreen;

            Assert.AreEqual(expected, actual);
        }
예제 #16
0
        // Token: 0x0600003C RID: 60 RVA: 0x00002F70 File Offset: 0x00001170
        private void ProfileSettingsList_Copy_Click(object sender, RoutedEventArgs e)
        {
            bool flag  = this.ProfileSettingsList.SelectedItem != null;
            bool flag2 = flag;
            bool flag3 = flag2;

            if (flag3)
            {
                DisplaySetting displaySetting = (DisplaySetting)this.ProfileSettingsList.SelectedItem;
                Clipboard.SetData(DataFormats.Text, displaySetting.value);
            }
        }
예제 #17
0
        public void CloseAfterPlayTest()
        {
            var target = new DisplaySetting();

            bool expected = true;
            bool actual;

            target.CloseAfterPlay = expected;
            actual = target.CloseAfterPlay;

            Assert.AreEqual(expected, actual);
        }
예제 #18
0
        public void YPosTest()
        {
            var target = new DisplaySetting();

            int expected = 13;
            int actual;

            target.YPos = expected;
            actual      = target.YPos;

            Assert.AreEqual(expected, actual);
        }
예제 #19
0
        public void WidthTest()
        {
            var target = new DisplaySetting();

            int expected = -1;
            int actual;

            target.Width = expected;
            actual       = target.Width;

            Assert.AreEqual(expected, actual);
        }
예제 #20
0
        public void EmbeddedTest()
        {
            var target = new DisplaySetting();

            bool expected = true;
            bool actual;

            target.Embedded = expected;
            actual          = target.Embedded;

            Assert.AreEqual(expected, actual);
        }
예제 #21
0
        public MainWindow()
        {
            InitializeComponent();
            DisplaySetting.DisplaySettingValue(this);

            this.FormClosing                            += Form1_FormClosing;
            this.notifyIcon1.DoubleClick                += notifyIcon1_DoubleClick;
            this.ExitToolStripMenuItem.Click            += ExitToolStripMenuItem_Click;
            this.openSmallScreenToolStripMenuItem.Click += openSmallScreenToolStripMenuItem_Click;
            this.openMainScreenToolStripMenuItem.Click  += openMainScreenToolStripMenuItem_Click;
            this.settingToolStripMenuItem.Click         += settingToolStripMenuItem_Click;
            this.detailViewToolStripMenuItem.Click      += detailViewToolStripMenuItem_Click;
        }
예제 #22
0
 public bool addDisplaySetting(DisplaySetting ds)
 {
     try
     {
         context.DisplaySettings.Add(ds);
         context.SaveChanges();
         var _displaySettingsRepository = context.DisplaySettings; displaySettingCollection.Clear();
         foreach (var d in _displaySettingsRepository)
         {
             displaySettingCollection.Add(d);
         }
     }
     catch { return(false); }
     return(true);
 }
예제 #23
0
        public bool RemoveDisplaySetting(DisplaySetting displaySetting)
        {
            bool result;

            try
            {
                var _displaySetting = context.DisplaySettings.Where(d =>
                                                                    d.Id == displaySetting.Id).FirstOrDefault();
                context.DisplaySettings.Remove(_displaySetting);
                context.SaveChanges();
                result = true;
            }
            catch { result = false; }
            return(result);
        }
        public VirtualAlphaNumericDisplay(DisplaySetting displaySetting, Configuration config, Action <int> toggleSettings)
        {
            LockHeight = true;
            if (config != null)
            {
                var alphanumConfig = (config.VirtualAlphaNumericDisplay as VirtualAlphaNumericDisplayConfig);
                var pos            = alphanumConfig?.GetPosition(displaySetting.Display);
                if (pos != null)
                {
                    Left   = pos.Left;
                    Top    = pos.Top;
                    Height = pos.Height;
                }
                else
                {
                    Height = 120;
                }
                AlwaysOnTop = config.VirtualAlphaNumericDisplay.StayOnTop;
                GripColor   = config.VirtualAlphaNumericDisplay.HideGrip ? Brushes.Transparent : Brushes.White;
            }
            else
            {
                Height = 120;
            }

            InitializeComponent();
            Initialize();

            _toggleSettings = toggleSettings;

            AlphaNumericDisplay.DisplaySetting = displaySetting;

            SettingsPath.Fill          = new SolidColorBrush(Colors.Transparent);
            SettingsButton.MouseEnter += (sender, e) => {
                SettingsPath.Fill   = new SolidColorBrush(Color.FromArgb(0x60, 0xff, 0xff, 0xff));
                SettingsPath.Stroke = new SolidColorBrush(Color.FromArgb(0x60, 0x0, 0x0, 0x0));
            };
            SettingsButton.MouseLeave += (sender, e) => {
                SettingsPath.Fill   = new SolidColorBrush(Colors.Transparent);
                SettingsPath.Stroke = new SolidColorBrush(Colors.Transparent);
            };
            SettingsButton.MouseLeftButtonDown += ToggleDisplaySettings;
        }
예제 #25
0
 private Monitor()
 {
     InitializeComponent();
     sequenceList       = new List <Sequence>();
     sequencesToDisplay = new Queue <Sequence>();
     DisplaySetting     = DisplaySetting.Everything;
     this.StartPosition = FormStartPosition.Manual;
     if (Screen.AllScreens.Length > 1)
     {
         this.DesktopLocation = new Point(Screen.AllScreens[1].WorkingArea.X, Screen.AllScreens[1].WorkingArea.Y);
         this.Height          = Screen.AllScreens[1].WorkingArea.Height;
         this.Width           = Screen.AllScreens[1].WorkingArea.Width;
     }
     else
     {
         this.Height  = Screen.AllScreens[0].WorkingArea.Height;
         this.Width   = Screen.AllScreens[0].WorkingArea.Width;
         this.TopMost = false;
     }
 }
예제 #26
0
        public IActionResult Index()
        {
            try
            {
                _logger.Information("Get Setting");
                UserSessionManager usrSession = new UserSessionManager();
                var    user   = User as ClaimsPrincipal;
                string userId = user.Claims.Where(c => c.Type == "USERID").Select(c => c.Value).SingleOrDefault();


                DisplaySetting displaySetting = new DisplaySetting
                {
                    objUser = usrSession.UserLog(userId)._userInfo
                };
                var query = new List <SettingModel>((List <SettingModel>)displaySetting.Display()).ToList();

                var response = new SettingModelOutput
                {
                    IsSuccess = true,
                    Code      = 200,
                    Message   = "Success",
                    Data      = query
                };


                return(Ok(response));
            }
            catch (Exception ex)
            {
                _logger.Error(ex.Message.ToString());
                var response = new SettingModelOutput
                {
                    IsSuccess = false,
                    Code      = 422,
                    Message   = ex.Message.ToString(),
                };
                return(Ok(response));
            }
        }
예제 #27
0
        // Token: 0x0600003B RID: 59 RVA: 0x00002F28 File Offset: 0x00001128
        private async Task UpdateProfileTabAsync()
        {
            this.ProfileDisplaySettings.Clear();
            await this.profileManager.LoadAsync();

            foreach (KeyValuePair <ProfileSettingName, string> kvp in this.profileManager.settingsById)
            {
                DisplaySetting ps = new DisplaySetting
                {
                    name  = kvp.Key.ToString(),
                    value = kvp.Value
                };
                if (!this.DisplaySettingsExclude.Contains(kvp.Key))
                {
                    this.ProfileDisplaySettings.Add(ps);
                }
                ps  = null;
                ps  = null;
                ps  = null;
                kvp = default(KeyValuePair <ProfileSettingName, string>);
            }
            Dictionary <ProfileSettingName, string> .Enumerator enumerator4 = default(Dictionary <ProfileSettingName, string> .Enumerator);
            Dictionary <ProfileSettingName, string> .Enumerator enumerator2 = default(Dictionary <ProfileSettingName, string> .Enumerator);
            Dictionary <ProfileSettingName, string> .Enumerator enumerator3 = default(Dictionary <ProfileSettingName, string> .Enumerator);
            this.ImgGamerPic.Source = new BitmapImage(new Uri(this.profileManager.GetProfileSetting(ProfileSettingName.GameDisplayPicRaw)));
            this.DisplayPrivileges.Clear();
            foreach (int priv in this.tokenManager.privileges)
            {
                if (PrivilegeNames.Has(priv))
                {
                    this.DisplayPrivileges.Add(PrivilegeNames.Get(priv));
                }
            }
            int[] array = null;
            this.LabelGt.Content   = this.profileManager.GetProfileSetting(ProfileSettingName.Gamertag);
            this.LabelXuid.Content = this.tokenManager.xuid;
        }
예제 #28
0
        private static void DeviceContext()
        {
            var navigation = new Dictionary <object, Action>
            {
                {
                    "DeviceContext: Display Adapters",
                    () =>
                    ConsoleNavigation.PrintObject(DisplayAdapter.GetDisplayAdapters().ToArray(),
                                                  display =>
                                                  ConsoleNavigation.PrintObject(display.GetDisplayDevices(),
                                                                                "Display.GetDisplayDevices()"),
                                                  "DisplayAdapter.GetDisplayAdapters()", "Select an adapter to show connected devices.")
                },
                {
                    "DeviceContext: Connected Displays",
                    () =>
                    ConsoleNavigation.PrintObject(Display.GetDisplays().ToArray(),
                                                  display => ConsoleNavigation.PrintObject(display.CurrentSetting, () =>
                    {
                        ConsoleNavigation.PrintObject(
                            display.GetPossibleSettings()
                            .OrderByDescending(
                                setting =>
                                (ulong)setting.Resolution.Height * (ulong)setting.Resolution.Width)
                            .Take(10)
                            .ToArray(),
                            setting => { display.SetSettings(new DisplaySetting(setting), true); },
                            "Display.GetValidSettings()", "Select a display setting to apply and enable.");
                    }, "Display.CurrentSetting", ""),
                                                  "Display.GetDisplays()", "Select a display to show current settings.")
                },
                {
                    "DeviceContext: Disconnected Displays",
                    () =>
                    ConsoleNavigation.PrintObject(UnAttachedDisplay.GetUnAttachedDisplays().ToArray(), display =>
                    {
                        ConsoleNavigation.PrintObject(
                            display.GetPossibleSettings()
                            .OrderByDescending(
                                setting =>
                                (ulong)setting.Resolution.Height * (ulong)setting.Resolution.Width)
                            .Take(10)
                            .ToArray(), setting =>
                        {
                            display.Enable(new DisplaySetting(setting));
                            DisplaySetting.ApplySavedSettings();
                        }, "Display.GetValidSettings()", "Select a display setting to apply and enable.");
                    }, "UnAttachedDisplay.GetUnAttachedDisplays()",
                                                  "Select an unattached display to show possible display settings to activate.")
                },
                {
                    "DeviceContext: Disable All Except Primary",
                    () =>
                    {
                        var displays = Display.GetDisplays().ToArray();
                        foreach (var display in displays.Where(display => !display.IsGDIPrimary))
                        {
                            display.Disable(false);
                        }
                        DisplaySetting.ApplySavedSettings();
                    }
                },
                {
                    "DeviceContext: Enable All",
                    () =>
                    {
                        var displays = UnAttachedDisplay.GetUnAttachedDisplays().ToArray();
                        foreach (var display in displays)
                        {
                            display.Enable(new DisplaySetting(display.GetPreferedSetting()));
                        }
                        DisplaySetting.ApplySavedSettings();
                    }
                }
            };

            ConsoleNavigation.PrintNavigation(navigation, "DeviceContext functions",
                                              "Select a DeviceContext sample.");
        }
예제 #29
0
        public CFExRepository()
        {
            progress = new Progress_Bar();
            displaySettingCollection  = new ObservableCollection <DisplaySetting>();
            dsColumnSettingCollection = new ObservableCollection <DSCollumnSetting>();
            visitorCollection         = new ObservableCollection <Visitor>();
            context = new ExContext();
            var d = context.DisplaySettings.ToList();

            if (d.Count() == 0)
            {
                //create default setting
                DisplaySetting defaultSetting = new DisplaySetting {
                    Name = "default", IsSelected = true
                };
                context.DisplaySettings.Add(defaultSetting); context.SaveChanges();
                //find setting in database wich contain parameter Id
                var defaulSetting = context.DisplaySettings.Where(s => s.Name == "default").FirstOrDefault();
                //add setting to repository
                displaySettingCollection.Add(defaulSetting);
                //find value Id for DisplaySettingId in DSCollumnSetting
                var defaulSettingId = defaulSetting.Id;
                //create collumn for default setting
                //add collumn in database
                context.DSCollumnSettings.Add(new DSCollumnSetting {
                    Name = "Id", Alias = "№", Width = 100, Visible = true, IsSelected = true, DisplaySettingId = defaulSettingId
                });
                context.DSCollumnSettings.Add(new DSCollumnSetting {
                    Name = "FirstName", Alias = "Имя", Width = 100, Visible = true, IsSelected = false, DisplaySettingId = defaulSettingId
                });
                context.DSCollumnSettings.Add(new DSCollumnSetting {
                    Name = "LastName", Alias = "Фамилия", Width = 100, Visible = true, IsSelected = false, DisplaySettingId = defaulSettingId
                });
                context.DSCollumnSettings.Add(new DSCollumnSetting {
                    Name = "Сompany", Alias = "Компания", Width = 100, Visible = true, IsSelected = false, DisplaySettingId = defaulSettingId
                });
                context.DSCollumnSettings.Add(new DSCollumnSetting {
                    Name = "Jobtitle", Alias = "Должность", Width = 100, Visible = true, IsSelected = false, DisplaySettingId = defaulSettingId
                });
                context.SaveChanges();
                //extract collumns from database which contain parameter Id and add its into the perository
                var _dsCollumnSettings = context.DSCollumnSettings;
                foreach (var c in _dsCollumnSettings)
                {
                    dsColumnSettingCollection.Add(c);
                }
            }
            else
            {
                //find settings in database
                var _displaySettingCollection = context.DisplaySettings;
                //add setting to repository
                foreach (var c in _displaySettingCollection)
                {
                    displaySettingCollection.Add(c);
                }
                //extract collumns from database which contain parameter Id and add its into the perository
                var _dsCollumnSettings = context.DSCollumnSettings;
                foreach (var c in _dsCollumnSettings)
                {
                    dsColumnSettingCollection.Add(c);
                }
            }
        }
예제 #30
0
 public EditParameterDialog()
 {
     InitializeComponent();
     _sizeSetting = _displaySettings.SizeSetting("Size");
 }
        public void XPosTest()
        {
            var target = new DisplaySetting();

            int expected = 540;
            int actual;
            target.XPos = expected;
            actual = target.XPos;

            Assert.AreEqual(expected, actual);
        }
예제 #32
0
 public DefaultPediaRenderer(DisplaySetting setting)
 {
     DisplaySetting = setting;
 }