Beispiel #1
0
 public IndexDetails()
 {
     InitializeComponent();
     this.DataContext        = new indexDetailsVM();
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
Beispiel #2
0
 public MarketWatch()
 {
     InitializeComponent();
     this.DataContext        = new MarketWatchVM();
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
 public ScripHelp()
 {
     InitializeComponent();
     this.DataContext        = new ScripHelpVM();
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
Beispiel #4
0
 public ReturnedOrders()
 {
     InitializeComponent();
     this.DataContext        = new ReturnedOrderVM();
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
Beispiel #5
0
 public All_Indices()
 {
     InitializeComponent();
     this.DataContext        = AllIndicesVM.GetInstance;
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
Beispiel #6
0
 public StopLossOrderEntry()
 {
     InitializeComponent();
     this.DataContext        = new StopLossOrderVM();
     dataGrid.GotFocus      += delegate(object sender, RoutedEventArgs e) { ((StopLossOrderVM)DataContext).AssignDataToForm(); };
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
 public PendingOrderClassic()
 {
     InitializeComponent();
     this.DataContext        = PendingOrderClassicVM.GETInstance;
     this.Owner              = Application.Current.MainWindow;
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
Beispiel #8
0
 public BSEBulletinsBoard()
 {
     InitializeComponent();
     this.DataContext        = new ViewModel.BSEBulletin.BSEBulletinsBoardVM();
     this.Owner              = Application.Current.MainWindow;
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
 public ScripInfo()
 {
     InitializeComponent();
     this.DataContext        = ScripInfoVM.GetInstance;
     this.Owner              = Application.Current.MainWindow;
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
        public BulkPriceChnage()
        {
            InitializeComponent();
            this.DataContext = BulkPriceChnageVM.GETInstance;
            this.Owner       = Application.Current.MainWindow;

            this.SourceInitialized += (x, y) =>
            {
                WindowExtensions.HideMinimizeAndMaximizeButtons(this);
            };
        }
Beispiel #11
0
        public NetPositionClientWise()
        {
            InitializeComponent();
#if TWS
            this.DataContext        = new NetPositionClientWiseVM();
            this.Owner              = Application.Current.MainWindow;
            IsWindowLoaded          = true;
            this.SourceInitialized += (x, y) =>
            {
                WindowExtensions.HideMinimizeAndMaximizeButtons(this);
            };
            //TODO workaround
            if (!string.IsNullOrEmpty(UtilityLoginDetails.GETInstance.Role))
            {
                if (UtilityLoginDetails.GETInstance.Role.ToLower() == "admin")
                {
                    foreach (var item in dgClientWise.Columns)
                    {
                        if (item.Header.ToString() == "ClientType")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "Client")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "Trader ID")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                    }
                }
                else if (UtilityLoginDetails.GETInstance.Role.ToLower() == "trader")
                {
                    foreach (var item in dgClientWise.Columns)
                    {
                        if (item.Header.ToString() == "ClientType")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "Client")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "Trader ID")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                    }
                }
            }
#endif
        }
Beispiel #12
0
        public NetPositionClientWiseDetails()
        {
            InitializeComponent();
#if TWS
            this.DataContext        = new NetPositionCWSWDetailsVM();
            this.Owner              = Application.Current.MainWindow;
            this.SourceInitialized += (x, y) =>
            {
                WindowExtensions.HideMinimizeAndMaximizeButtons(this);
            };
#endif
        }
 public BestFiveMarketPicture()
 {
     InitializeComponent();
     this.DataContext = new BestFiveVM();
     if (Application.Current.MainWindow.IsLoaded)
     {
         this.Owner = Application.Current.MainWindow;
     }
     this.SourceInitialized += (x, y) =>
     {
         WindowExtensions.HideMinimizeAndMaximizeButtons(this);
     };
 }
        public Saudas_Admin()
        {
            InitializeComponent();
#if TWS
            this.DataContext        = new AdminTradeViewVM();
            this.SourceInitialized += (x, y) =>
            {
                WindowExtensions.HideMinimizeAndMaximizeButtons(this);
            };
            //TODO workaround
            if (!string.IsNullOrEmpty(UtilityLoginDetails.GETInstance.Role))
            {
                if (UtilityLoginDetails.GETInstance.Role.ToLower() == "admin")
                {
                    foreach (var item in dataGridView1.Columns)
                    {
                        if (item.Header.ToString() == "TraderID")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "Scrip Code")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "Scrip Id")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "LocationID")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "DateTime")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "Time")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                    }
                }
                else if (UtilityLoginDetails.GETInstance.Role.ToLower() == "trader")
                {
                    foreach (var item in dataGridView1.Columns)
                    {
                        if (item.Header.ToString() == "TraderID")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "Scrip Code")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "Scrip Id")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                        else if (item.Header.ToString() == "LocationID")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "DateTime")
                        {
                            item.Visibility = System.Windows.Visibility.Collapsed;
                        }
                        else if (item.Header.ToString() == "Time")
                        {
                            item.Visibility = System.Windows.Visibility.Visible;
                        }
                    }
                }
            }

            //if (Application.Current.MainWindow.IsLoaded)
            //    this.Owner = Application.Current.MainWindow;
#endif
        }
Beispiel #15
0
        /// <summary>
        /// Called when the window has loaded
        /// </summary>
        private void OnLoad(object sender, RoutedEventArgs e)
        {
            // Window icon
            var icon = WindowExtensions.ImageSourceFromIcon(Properties.Resources.oof);

            if (icon != null)
            {
                Icon = icon;
            }

            // Hide/disable minimize button
            WindowExtensions.HideMinimizeAndMaximizeButtons(this, hideMaximize: false);

            // Restore window size and position, if any
            try
            {
                var settingsManager = new ShellSettingsManager(Package);

                WritableSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

                if (WritableSettingsStore.CollectionExists(SS_Collection) == true)
                {
                    // These two are required from now on
                    WindowStartupLocation = WindowStartupLocation.Manual;
                    SizeToContent         = SizeToContent.Manual;

                    // Window size and position
                    Top         = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowTop);
                    Left        = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowLeft);
                    Height      = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowHeight);
                    Width       = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowWidth);
                    WindowState = (WindowState)WritableSettingsStore.GetInt32(SS_Collection, SS_WindowState);

                    // Other settings
                    chActiveItem.IsChecked = WritableSettingsStore.GetBoolean(SS_Collection, SS_ActiveItem);

                    rbLeftPanelTC.IsChecked  = WritableSettingsStore.GetBoolean(SS_Collection, SS_LeftPanelTC);
                    rbRightPanelTC.IsChecked = WritableSettingsStore.GetBoolean(SS_Collection, SS_RightPanelTC);

                    if (rbLeftPanelTC.IsChecked == rbRightPanelTC.IsChecked)
                    {
                        // Impossible case that should not be possible but has somehow happened, so here is the fix
                        rbLeftPanelTC.IsChecked  = true;
                        rbRightPanelTC.IsChecked = false;
                    }
                }
                else
                {
                    // Create collection now to be able to check for other settings the 1st time around
                    WritableSettingsStore.CreateCollection(SS_Collection);

                    // Must have a default
                    rbLeftPanelTC.IsChecked = true;
                }
            }
            catch (Exception)
            {
                // Ignore quietly
            }

            // Load configurations and active path
#pragma warning disable VSTHRD010

            if (Paths.ListSolutionConfigurations(Dte, lbConfigurations, ref _activePath) == false)
            {
                // Something went wrong so abort
                // Error reporting, if any, is to be done in the calling method above
                Close();
            }

#pragma warning restore VSTHRD010

            // Double-click on an item brings up TotalCommander without further ado
            lbConfigurations.MouseDoubleClick += LbConfigurations_MouseDoubleClick;
        }
Beispiel #16
0
        /// <summary>
        /// Called when the window has loaded
        /// </summary>
        private void OnLoad(object sender, RoutedEventArgs e)
        {
            // Window icon
            var icon = WindowExtensions.ImageSourceFromIcon(Properties.Resources.hug);

            if (icon != null)
            {
                Icon = icon;
            }

            // Hide/disable minimize button
            WindowExtensions.HideMinimizeAndMaximizeButtons(this, hideMaximize: false);

            // Load available tags
            HugTags.I.Load();

            // Restore window size and position, if any
            try
            {
                var settingsManager = new ShellSettingsManager(Package);

                WritableSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

                if (WritableSettingsStore.CollectionExists(SS_Collection) == true &&
                    WritableSettingsStore.PropertyExists(SS_Collection, SS_WindowTop) == true)
                {
                    // These two are required from now on
                    WindowStartupLocation = WindowStartupLocation.Manual;
                    SizeToContent         = SizeToContent.Manual;

                    // Window size and position
                    Top         = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowTop);
                    Left        = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowLeft);
                    Height      = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowHeight);
                    Width       = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowWidth);
                    WindowState = (WindowState)WritableSettingsStore.GetInt32(SS_Collection, SS_WindowState);

                    // Other settings
                    chAutoSort.IsChecked = WritableSettingsStore.GetBoolean(SS_Collection, SS_AutoSort);
                }
                else
                {
                    // Create collection now to be able to check for other settings the 1st time around
                    WritableSettingsStore.CreateCollection(SS_Collection);

                    // Default to sorted by count
                    chAutoSort.IsChecked = true;
                }

                // Disable when automatic sorting by count is enabled
                btUp.IsEnabled = btDown.IsEnabled = (chAutoSort.IsChecked == false);
            }
            catch (Exception ex)
            {
                // Report and move on
                Box.Error("Unable to load settings.",
                          "Exception:",
                          ex.Message);
            }

            // Display tags
            HugTags.I.SortByCount(chAutoSort.IsChecked ?? false);

            lvTags.ItemsSource = HugTags.I.Items;
        }
Beispiel #17
0
        /// <summary>
        /// Called when Snippeter's window has loaded
        /// </summary>
        private void OnLoad(object sender, RoutedEventArgs e)
        {
            // Window icon
            var icon = WindowExtensions.ImageSourceFromIcon(Properties.Resources.snippeter);

            if (icon != null)
            {
                Icon = icon;
            }

            // Hide/disable minimize button
            WindowExtensions.HideMinimizeAndMaximizeButtons(this, hideMaximize: false);

            // Restore window size and position, if any
            try
            {
                var settingsManager = new ShellSettingsManager(Package);

                WritableSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

                if (WritableSettingsStore.CollectionExists(SS_Collection) == true)
                {
                    // These two are required from now on
                    WindowStartupLocation = WindowStartupLocation.Manual;
                    SizeToContent         = SizeToContent.Manual;

                    // Window size and position
                    Top         = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowTop);
                    Left        = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowLeft);
                    Height      = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowHeight);
                    Width       = WritableSettingsStore.GetInt32(SS_Collection, SS_WindowWidth);
                    WindowState = (WindowState)WritableSettingsStore.GetInt32(SS_Collection, SS_WindowState);
                }
                else
                {
                    // Create collection now to be able to check for other settings the 1st time around
                    WritableSettingsStore.CreateCollection(SS_Collection);
                }
            }
            catch (Exception)
            {
                // Ignore quietly
            }

            if (lvSnippets.Visibility == Visibility.Visible)
            {
                // Manager mode, thus load available snippets
                try
                {
                    var paths = UserSnippetPath.GetFilesInFolder("*.snippet");

                    LoadSnippets(paths);
                }
                catch (Exception ex)
                {
                    Box.Error("Unable to obtain snippets from the user's snippet directory and, thus, will not run Snippeter.",
                              "Exception: ", ex.Message);

                    Close();
                }

                lvSnippets.ItemsSource = _snippets.Values;
            }
        }