Пример #1
0
        /// <summary>
        /// 添加证券成份
        /// </summary>
        public void AddSecurities()
        {
            List <GridRow> selectedCategoryRows = m_gridCategory.SelectedRows;
            int            rowsSize             = selectedCategoryRows.Count;

            if (rowsSize > 0)
            {
                UserSecurityCategory category = new UserSecurityCategory();
                m_userSecurityService.GetCategory(selectedCategoryRows[0].GetCell(0).GetString(), ref category);
                SecurityList securityList = new SecurityList(m_native);
                securityList.Show();
                WindowEx window = securityList.Window;
                window.IsChildWindow = true;
                window.Tag           = securityList;
                if (category.m_codes != null && category.m_codes.Length > 0)
                {
                    List <Security> securities = new List <Security>();
                    m_securityService.GetSecuritiesByCodes(category.m_codes, securities);
                    securityList.AddSecuritiesToSecuritiesGrid(securities);
                }
                WindowClosingEvent windowClosingEvent = new WindowClosingEvent(SecurityListWindowClosed);
                window.RegisterEvent(windowClosingEvent, EVENTID.WINDOWCLOSING);
                m_native.Invalidate();
            }
        }
Пример #2
0
 public GeneralPage()
 {
     _mainWindow   = WindowEx.GetCurrentFirst <MainWindow>();
     _configWindow = WindowEx.GetCurrentFirst <ConfigWindow>();
     InitializeComponent();
     ScannerViewModel = Service.Get <OsuFileScanner>().ViewModel;
 }
Пример #3
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public void Dispose()
 {
     if (!m_isDisposed)
     {
         m_chart = null;
         if (m_gridFilterResult != null)
         {
             m_gridFilterResult.UnRegisterEvent(m_gridCellClick, EVENTID.GRIDCELLCLICK);
             m_gridCellClick    = null;
             m_gridFilterResult = null;
         }
         if (m_window != null)
         {
             m_window.StopTimer(m_timerID);
             m_window.UnRegisterEvent(m_timerEvent, EVENTID.TIMER);
             m_timerEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         if (m_xml != null)
         {
             m_xml.Dispose();
             m_xml = null;
         }
         m_isDisposed = true;
     }
 }
Пример #4
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         int divsSize = m_divs.Count;
         for (int i = 0; i < divsSize; i++)
         {
             SandBoxCandleDiv div = m_divs[i];
             if (div.Moving)
             {
                 m_native.RemoveControl(div);
             }
             else
             {
                 m_window.RemoveControl(div);
             }
             div.Dispose();
         }
         m_divs.Clear();
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_timerEvent, EVENTID.TIMER);
             m_timerEvent = null;
             m_window.StopTimer(m_timerID);
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #5
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         m_chart = null;
         if (m_gridIcons != null)
         {
             m_gridIcons.UnRegisterEvent(m_gridCellClickEvent, EVENTID.GRIDCELLCLICK);
             m_gridCellClickEvent = null;
             m_gridIcons          = null;
         }
         if (m_gridMacros != null)
         {
             m_gridMacros.UnRegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
             m_gridSelectedRowsChangedEvent = null;
             m_gridMacros = null;
         }
         if (m_macroService != null)
         {
             m_macroService.UnRegisterListener(m_macroService.OperatorRequestID, m_macroDataCallBack);
             m_macroDataCallBack = null;
             m_macroService      = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #6
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         m_chart = null;
         if (m_gridLayouts != null)
         {
             m_gridLayouts.UnRegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
             m_gridSelectedRowsChangedEvent = null;
             m_gridLayouts = null;
         }
         if (m_indicatorLayoutService != null)
         {
             m_indicatorLayoutService.UnRegisterListener(m_indicatorLayoutService.OperatorRequestID, m_indicatorLayoutDataCallBack);
             m_indicatorLayoutDataCallBack = null;
             m_indicatorLayoutService      = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #7
0
        /// <summary>
        /// 重置缩放尺寸
        /// </summary>
        /// <param name="clientSize">客户端大小</param>
        public void ResetScaleSize(SIZE clientSize)
        {
            INativeBase native = Native;

            if (native != null)
            {
                ControlHost     host         = native.Host;
                SIZE            nativeSize   = native.DisplaySize;
                List <ControlA> controls     = native.GetControls();
                int             controlsSize = controls.Count;
                for (int i = 0; i < controlsSize; i++)
                {
                    WindowFrameA frame = controls[i] as WindowFrameA;
                    if (frame != null)
                    {
                        WindowEx window = frame.GetControls()[0] as WindowEx;
                        if (window != null && !window.AnimateMoving)
                        {
                            POINT location = window.Location;
                            if (location.x < 10 || location.x > nativeSize.cx - 10)
                            {
                                location.x = 0;
                            }
                            if (location.y < 30 || location.y > nativeSize.cy - 30)
                            {
                                location.y = 0;
                            }
                            window.Location = location;
                        }
                    }
                }
                native.ScaleSize = new SIZE((int)(clientSize.cx * m_scaleFactor), (int)(clientSize.cy * m_scaleFactor));
                native.Update();
            }
        }
Пример #8
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         if (m_securityService != null)
         {
             m_securityService.UnRegisterListener(m_securitiesRequestID, m_securityDataCallBack);
             m_securityDataCallBack = null;
             m_securityService      = null;
         }
         if (m_tvBlock != null)
         {
             m_tvBlock.RegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
             m_gridSelectedRowsChangedEvent = null;
             m_gridSelectedRowsChangedEvent = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #9
0
        public void Attach(DependencyObject associatedObject)
        {
            AssociatedObject = associatedObject;
            _throttleHelper.ThrottledEvent += ThrottleHelperOnThrottledEvent;

            // process start
            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                Element.Visibility = Visibility.Visible;
            }
            else
            {
                // handle click
                Element.Click += new Common.WeakReference <NavButtonBehavior, object, RoutedEventArgs>(this)
                {
                    EventAction  = (i, s, e) => i.Element_Click(s, e),
                    DetachAction = (i, w) => Element.Click -= w.Handler,
                }.Handler;
                CalculateThrottled();


                // TODO: critical!
                // if (Locator.BootStrapper.Instance != null) Locator.BootStrapper.Instance.ShellBackButtonUpdated += Current_ShellBackButtonUpdated;


                _deviceUtils = DeviceUtils.Current(WindowEx.Current());
                if (_deviceUtils != null)
                {
                    _deviceUtils.Changed += DispositionChanged;
                }
            }
        }
Пример #10
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void Dispose()
 {
     if (!IsDisposed)
     {
         m_chart = null;
         if (m_gridTemplate != null)
         {
             m_gridTemplate.UnRegisterEvent(m_gridSelectedRowsChangedEvent, EVENTID.GRIDSELECTEDROWSCHANGED);
             m_gridSelectedRowsChangedEvent = null;
             m_gridTemplate = null;
         }
         if (m_securityFilterService != null)
         {
             m_securityFilterService.UnRegisterListener(m_securityFilterService.OperatorRequestID, m_securityFilterDataCallBackEvent);
             m_securityFilterDataCallBackEvent = null;
             m_securityFilterService           = null;
         }
         if (m_window != null)
         {
             m_window.UnRegisterEvent(m_invokeEvent, EVENTID.INVOKE);
             m_invokeEvent = null;
             m_window.StopTimer(m_timerID);
             m_window.UnRegisterEvent(m_timerEvent, EVENTID.TIMER);
             m_timerEvent = null;
             m_window.Close();
             m_window.Dispose();
             m_window = null;
         }
         base.Dispose();
     }
 }
Пример #11
0
 /// <summary>
 /// Inicjuje nową instancję klasy.
 /// </summary>
 /// <param name="wpfWindow">Okno WPF.</param>
 public MapWin32Window(System.Windows.Window wpfWindow)
 {
     if (wpfWindow == null)
     {
         wpfWindow = WindowEx.GetActiveWindow();
     }
     Handle = new System.Windows.Interop.WindowInteropHelper(wpfWindow).Handle;
 }
Пример #12
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (WindowEx.xIsModal(this))
     {
         base.DialogResult = new bool?(false);
     }
     base.Close();
 }
Пример #13
0
 private void btnClose_Click(object sender, RoutedEventArgs e)
 {
     if (WindowEx.xIsModal(this))
     {
         DialogResult = false;
     }
     Close();
 }
Пример #14
0
        private void SetAppFontSize()
        {
            var appWindows = WindowEx.GetAppWindows <WndAssist>();

            foreach (WndAssist wndAssist in appWindows.xSafeForEach())
            {
                wndAssist.FontSize = Params.Other.FontSize;
            }
        }
Пример #15
0
 public void Attach(DependencyObject associatedObject)
 {
     AssociatedObject = associatedObject;
     _dispatcher      = WindowEx.Current().Dispatcher;
     Central.Messenger.Subscribe <Messages.BackRequestedMessage>(this, e =>
     {
         Interaction.ExecuteActions(AssociatedObject, Actions, null);
     });
 }
Пример #16
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     if (WindowEx.xIsModal(this))
     {
         base.DialogResult = new bool?(true);
     }
     this.IsOkClicked = true;
     base.Close();
 }
Пример #17
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     this._isYesButtonClicked = false;
     if (WindowEx.xIsModal(this))
     {
         DialogResult = new bool?(false);
     }
     Close();
 }
Пример #18
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     this._isYesButtonClicked = true;
     if (WindowEx.xIsModal(this))
     {
         base.DialogResult = new bool?(true);
     }
     Close();
 }
Пример #19
0
 public bool CreateNewFile()
 {
     if (Exists() || !_parent.Exists())
     {
         return(false);
     }
     LocalStorage.SetItem(GetCanonicalPath(), WindowEx.Btoa(""));
     return(true);
 }
Пример #20
0
        private static void ConfigureAppWindow(WindowEx wnd)
        {
            wnd.MinWidth    = 900;
            wnd.MinHeight   = 600;
            wnd.TaskBarIcon = Icon.FromFile("Images/MainIcon.ico");
            wnd.Title       = "MVP Companion";

            wnd.SetWindowSize(1200, 900);
            wnd.CenterOnScreen();
        }
Пример #21
0
 public NavButtonBehavior()
 {
     if (!Windows.ApplicationModel.DesignMode.DesignModeEnabled)
     {
         _dispatcher     = WindowEx.Current().Dispatcher;
         _throttleHelper = new EventThrottleHelper {
             Throttle = 1000
         };
     }
 }
Пример #22
0
 public override void Flush()
 {
     if (!_isDirty)
     {
         return;
     }
     Consolidate();
     LocalStorage.SetItem(_name, WindowEx.Btoa(_data));
     _isDirty = false;
 }
Пример #23
0
 public void Attach(DependencyObject associatedObject)
 {
     AssociatedObject = associatedObject;
     _deviceUtils     = DeviceUtils.Current(WindowEx.Current());
     if (_deviceUtils != null)
     {
         _deviceUtils.Changed += DeviceDispositionBehavior_Changed;
     }
     Update();
     _ready = true;
 }
Пример #24
0
 private void btnOK_Click(object sender, RoutedEventArgs e)
 {
     if (this._data.Submitable())
     {
         if (WindowEx.xIsModal(this))
         {
             DialogResult = true;
         }
         this._isClosedByOkButton = true;
         Close();
     }
 }
Пример #25
0
 public static void HideBusy()
 {
     WindowEx.Current().Dispatcher.Dispatch(() =>
     {
         var modal = Window.Current.Content as ModalDialog;
         var view  = modal.ModalContent as Busy;
         if (view != null)
         {
             modal.IsModal = view.IsBusy = false;
         }
     });
 }
Пример #26
0
        internal object OpenNamedWindow(FormDefinition formDef, XElement xml, ActivityHarness sourceHarness)
        {
            string url = FormsURL + formDef.Path;
            object o   = null;

            try
            {
                System.Xml.XmlTextReader rdr = UrlAsXmlTextReader(url);
                o = XamlReader.Load(rdr);
            }
            catch (Exception ex)
            {
                ApplicationEx.DebugException(ex, url);
                return(null);
            }

            if (o is WindowEx)
            {
                WindowEx w = (WindowEx)o;
                if (sourceHarness == null)
                {
                    w.Initialise(xml);
                }
                else
                {
                    w.InitialiseCopy(sourceHarness);
                }
                w.Show();
            }
            else if (o is TabItem)
            {
                TabItem ti = (TabItem)o;
                if (ti is TabItemEx)
                {
                    TabItemEx ati = (TabItemEx)ti;
                    ati.IsDynamic = true;
                    if (sourceHarness == null)
                    {
                        ati.Initialise(xml);
                    }
                    else
                    {
                        ati.InitialiseCopy(sourceHarness);
                        ati.Harness.IsActivityOwner = false;
                    }
                }
                //homeTabControl.Items.Add(ti);
                //homeTabControl.SelectedItem = ti;
            }

            return(o);
        }
Пример #27
0
        public static T GetMainNickSameWindow <T>(string seller) where T : EtWindow
        {
            List <T> appWindows = WindowEx.GetAppWindows <T>();

            foreach (T t in appWindows.xSafeForEach <T>())
            {
                if (TbNickHelper.IsSameShopAccount(t.Seller, seller))
                {
                    return(t);
                }
            }
            return(default(T));
        }
Пример #28
0
 public MainWindow()
 {
     InitializeComponent();
     this.DataContext         = this;
     App.Current.MainWindow   = this;
     App.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
     FilterBox.Text           = "13";
     msgWin                   = new WindowEx().ShowInvisible(this);
     msgWin.AllMsg           += WindowEx_AllMsg;
     Listen                   = true;
     ListenCheckBox.IsChecked = true;
     //RegisterHook(HookType.WH_KEYBOARD_LL);
 }
Пример #29
0
        public static void Close(string closeKey)
        {
            var wnds = WindowEx.GetAppWindows <WndTrayTip>();

            if (wnds.xCount() > 0)
            {
                var wnd = wnds.FirstOrDefault(k => k.Tag == closeKey);
                if (wnd != null)
                {
                    wnd.Close();
                }
            }
        }
Пример #30
0
        /// <summary>
        /// 加载界面
        /// </summary>
        public virtual void Load(INativeBase native, string xmlName, string windowName)
        {
            Native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\" + xmlName + ".html";

            Script = new GaiaScript(this);
            LoadFile(xmlPath, null);
            m_window      = FindControl(windowName) as WindowEx;
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册点击事件
            RegisterEvents(m_window);
        }