Beispiel #1
0
        /// <summary>
        /// 创建便签
        /// </summary>
        /// <param name="path">缓存路径</param>
        /// <param name="imdex"></param>
        /// <param name="oldNotepad"></param>
        public static void CreateNotepad(string path, int imdex, WindowNotepad oldNotepad)
        {
            if (WindowList.Count >= 15)
            {
                MessageBox.Show("便签数据日经达到最大值15个!", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }
            if (WindowList.Exists(t => t.CacheFileName == path))
            {
                return;
            }

            WindowNotepad      window            = null;
            WindowSettingsAllM windowSettingsAll = ReadSetings();
            string             id       = Path.GetFileNameWithoutExtension(path);
            WindowSettingsM    settings = windowSettingsAll?.WindowSettingses.Find(t => t.ID == id);

            if (settings == null)
            {
                settings = GetDefaultWindowSettingsM(id);
            }

            window = new WindowNotepad(settings);
            SetTop(window, oldNotepad);
            window.Show();
            WindowList.Add(window);
            ShowWindowListCount++;
            WindowListCount++;
        }
Beispiel #2
0
        public override void Add(Segment segment)
        {
            segment.SequenceNumber = _currentSeqNumber;
            _currentSeqNumber     += (byte)segment.Data.Length;

            WindowList.Add(segment);
        }
Beispiel #3
0
        public void CreateMainWindow()
        {
            var win = new MainV();

            win.Show();
            win.UpdateLayout();
            MainWindow = win;
            WindowList.Add(win.Title, win);
        }
Beispiel #4
0
 private static void PrepareTabControllerSupport(bool noTabber, ConnectionWindow connectionForm)
 {
     if (noTabber)
     {
         connectionForm.TabController.Dispose();
     }
     else
     {
         WindowList.Add(connectionForm);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Window constructor
 /// </summary>
 /// <param name="xpos">x position to build window at</param>
 /// <param name="ypos">y position to build window at</param>
 /// <param name="visible">start off as visible or invisible</param>
 /// <param name="texture">texture of the window</param>
 public Window(int xpos, int ypos, bool visible, Texture2D texture)
     : base(texture)
 {
     Position.X = xpos;
     Position.Y = ypos;
     Visible    = visible;
     ButtonList = new List <Button>();
     m_Texture  = texture;
     TowerDefenseManager.TDLayers[3].AddEntity(this);
     WindowList.Add(this);
     Xoffset = 10 + (int)Position.X;
     Yoffset = 10 + (int)Position.Y;
 }
Beispiel #6
0
        public virtual void TransitionTo(ViewModelBase newWindow)
        {
            PreviousWindow = CurrentWindow;
            CurrentWindow  = newWindow;

            CurrentWindowListIndex++;

            for (int i = CurrentWindowListIndex; i < WindowList.Count; i++)
            {
                WindowList.RemoveRange(i, WindowList.Count - i);
            }

            WindowList.Add(CurrentWindow);
        }
Beispiel #7
0
 private void PaneUpdated(OutputWindowPane pane)
 {
     if (!WindowList.Contains(pane.Name))
     {
         WindowList.Add(pane.Name);
         if (string.IsNullOrEmpty(CurrentWindow))
         {
             CurrentWindow = pane.Name;
         }
     }
     if (!_windowNames.ContainsKey(pane.Name))
     {
         _windowNames.Add(pane.Name, pane.Guid);
     }
     // See [IDE GUID](https://docs.microsoft.com/en-us/visualstudio/extensibility/ide-guids?view=vs-2017 )
     PorcessNewInput(pane);
     UpdateOutput();
 }
        public override void Perform()
        {
            //There will be at most 5 Windows. And It can't remove the first Window.
            if (WindowList.Count > 5 || (IsRemove && WindowList.Count > 1))
            {
                //The new Window already got created and shown.
                NewWindow.Close();

                //Select removed Window from 1 to Count-1.
                RemoveIndex = RemoveIndex % (WindowList.Count - 1) + 1;
                Window removeWindow = WindowList[RemoveIndex];

                //Close the window before removing it.
                removeWindow.Close();

                WindowList.Remove(removeWindow);
            }
            else
            {
                WindowList.Add(NewWindow);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 创建便签
        /// </summary>
        /// <param name="path">缓存路径</param>
        /// <param name="settingses"></param>
        public static void CreateNotepad(string path, List <WindowSettingsM> settingses)
        {
            if (WindowList.Exists(t => t.CacheFileName == path))
            {
                return;
            }

            WindowNotepad window = null;

            string id = Path.GetFileNameWithoutExtension(path);

            WindowSettingsM settings = settingses.Find(t => t.ID == id);

            if (settings == null)
            {
                settings = GetDefaultWindowSettingsM(id);
            }

            window = new WindowNotepad(settings);
            window.Show();
            WindowList.Add(window);
            ShowWindowListCount++;
            WindowListCount++;
        }
        public void WindowIsInListAfterBeingAdded()
        {
            BaseWindow window = new BaseWindow();

            _windowList.Add(window);
            Assert.That(_windowList, Has.Member(window));
        }
Beispiel #11
0
 public override void Add(Segment segment)
 {
     WindowList.Add(segment);
 }