示例#1
0
 public InputVisualObject(int x, int y, int width, int height, UIConfiguration configuration = null,
                          UIStyle style = null, Action <VisualObject, Touch> callback = null, T defaultValue = default, Action <InputVisualObject <T>, T> inputCallback = null)
     : base(x, y, width, height, configuration, style, callback)
 {
     InputCallback = inputCallback;
     DefaultValue  = defaultValue;
 }
示例#2
0
        public void TestUiConfigLoadSave()
        {
            UIConfiguration c = new UIConfiguration();

            c.Treshold               = Level.INFO;
            c.ColumnsWidths.Logger   = 1;
            c.ColumnsWidths.Domain   = 2;
            c.ColumnsWidths.Thread   = 3;
            c.ColumnsWidths.UserName = 4;
            c.ColumnsWidths.Date     = 20;
            c.ColumnsWidths.Time     = 30;
            c.ColumnsWidths.Exc      = 40;
            c.ColumnsWidths.Message  = 50;
            c.Save();

            UIConfiguration c2 = new UIConfiguration();

            c2.Load();

            Assert.AreEqual(c.Treshold, c2.Treshold);
            Assert.AreEqual(c.ColumnsWidths.Logger, c2.ColumnsWidths.Logger);
            Assert.AreEqual(c.ColumnsWidths.Domain, c2.ColumnsWidths.Domain);
            Assert.AreEqual(c.ColumnsWidths.Thread, c2.ColumnsWidths.Thread);
            Assert.AreEqual(c.ColumnsWidths.UserName, c2.ColumnsWidths.UserName);
            Assert.AreEqual(c.ColumnsWidths.Date, c2.ColumnsWidths.Date);
            Assert.AreEqual(c.ColumnsWidths.Time, c2.ColumnsWidths.Time);
            Assert.AreEqual(c.ColumnsWidths.Exc, c2.ColumnsWidths.Exc);
            Assert.AreEqual(c.ColumnsWidths.Message, c2.ColumnsWidths.Message);

            Console.WriteLine("Tests succeeded");
        }
示例#3
0
文件: Video.cs 项目: elfin8er/TUI
 public Video(int x, int y, UIConfiguration configuration = null, UIStyle style = null,
              Action <VisualObject, Touch> callback       = null)
     : base(x, y, 8, 5, configuration, style, callback)
 {
     Timer.Interval = VideoStyle.Delay;
     Timer.Elapsed += Next;
 }
示例#4
0
文件: Button.cs 项目: elfin8er/TUI
        /// <summary>
        /// Widget for invoking callback and blinking on touch.
        /// </summary>
        public Button(int x, int y, int width, int height, string text, UIConfiguration configuration = null,
                      ButtonStyle style = null, Action <VisualObject, Touch> callback = null)
            : base(x, y, width, height, text, configuration, style ?? new ButtonStyle(), callback)
        {
            if (Configuration.Lock == null)
            {
                Configuration.Lock = new Lock(LockLevel.Self, false, ButtonStyle.BlinkDelay, true, true);
            }
            else
            {
                Configuration.Lock.Personal = false;
                Configuration.Lock.Delay    = ButtonStyle.BlinkDelay;
                Configuration.Lock.AllowThisTouchSession = true;
                Configuration.Lock.DuringTouchSession    = true;
            }
            Configuration.UseBegin          = true;
            Configuration.UseEnd            = true;
            Configuration.SessionAcquire    = true;
            Configuration.BeginRequire      = true;
            Configuration.UseOutsideTouches = true;

            Indent indent    = ButtonStyle.TextIndent;
            int    minIndent = ButtonStyle.BlinkStyle == ButtonBlinkStyle.Left ? 3 : ButtonStyle.BlinkStyle == ButtonBlinkStyle.Right ? 2 : 0;

            if (indent.Left < minIndent)
            {
                indent.Left = minIndent;
            }
            if (indent.Right < minIndent)
            {
                indent.Right = minIndent;
            }
        }
 // Initiate new configuration
 void Init()
 {
     ui                     = new UIConfiguration();
     global                 = new GlobalConfiguration();
     cellularAlgorithm      = new CellularAlgorithmConfig();
     mazeAlgorithm          = new MazeAlgorithmConfig();
     simpleDungeonAlgorithm = new SimpleDungeonAlgorithmConfig();
     bspDungeonAlgorithm    = new BSPDungeonAlgorithmConfig();
 }
 public RpcHistoryService(
     IOptions <UIConfiguration> options,
     ILogger <WorkerService> logger)
 {
     this.settings   = options.Value;
     this.logger     = logger;
     this.httpClient = new HttpClient();
     this.baseUri    = new Uri(settings.RealTimeHistoryBasePath ?? "http://127.0.0.1:5088");
 }
示例#7
0
文件: Panel.cs 项目: elfin8er/TUI
 public PanelResize(int x, int y, int width, int height, UIConfiguration configuration = null,
                    UIStyle style = null, Action <VisualObject, Touch> callback = null)
     : base(x, y, width, height, configuration, style, callback)
 {
     Configuration.UseEnd = true;
     Layer = Int32.MaxValue;
     if (Callback == null)
     {
         Callback = CustomCallback;
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ILSDarmStadtOperationView"/> class.
        /// </summary>
        public ILSDarmStadtOperationView()
        {
            InitializeComponent();

            _configuration = UIConfiguration.Load();

            _viewModel = new ILSDarmStadtOperationViewModel();
            this.DataContext = _viewModel;

            this.Loaded += ILSDarmStadtOperationView_Loaded;
        }
示例#9
0
 /// <summary>
 /// Touching and drawing settings for VisualObject.
 /// </summary>
 public UIConfiguration(UIConfiguration configuration)
 {
     this.Lock              = new Lock(configuration.Lock);
     this.Permission        = configuration.Permission;
     this.Custom            = new CustomCallbacks(configuration.Custom);
     this.SessionAcquire    = configuration.SessionAcquire;
     this.BeginRequire      = configuration.BeginRequire;
     this.UseOutsideTouches = configuration.UseOutsideTouches;
     this.Ordered           = configuration.Ordered;
     this.UseBegin          = configuration.UseBegin;
     this.UseMoving         = configuration.UseMoving;
     this.UseEnd            = configuration.UseEnd;
 }
示例#10
0
        public VisualSign(int x, int y, int width, int height, string text, UIConfiguration configuration = null,
                          UIStyle style = null, Action <VisualObject, Touch> callback = null)
            : base(x, y, width, height, configuration, style, callback)
        {
            if (width > 2 || height > 2)
            {
                throw new ArgumentException("Sign can only have one of these sizes: 1x1, 1x2, 2x1, 2x2.");
            }

            RawText = text ?? "";

            // Needed for ApplyTiles() (it checks if any of UIStyle parameters are set)
            Style.Active = true;
        }
示例#11
0
 /// <summary>
 /// Basic root of user interface tree widget.
 /// </summary>
 /// <param name="name">Unique interface identifier</param>
 /// <param name="provider">Tile provider object, default value - null (interface would
 /// be drawn on the Main.tile, tiles would be irrevocably modified).
 /// <para></para>
 /// FakeTileRectangle from [FakeManager](https://github.com/AnzhelikaO/FakeManager)
 /// can be passed as a value so that interface would be drawn above the Main.tile.</param>
 public RootVisualObject(string name, int x, int y, int width, int height,
                         UIConfiguration configuration = null, ContainerStyle style = null, object provider = null)
     : base(x, y, width, height, configuration ?? new UIConfiguration() { UseBegin = true, UseMoving = true, UseEnd = true }, style)
 {
     Configuration.UseOutsideTouches = false;
     Name = name;
     if (provider == null)
     {
         Provider = new MainTileProvider();
     }
     else
     {
         Provider = provider;
     }
 }
示例#12
0
文件: Panel.cs 项目: elfin8er/TUI
        /// <summary>
        /// Root widget that saves its position and size and has a button for changing position
        /// and a button for changing size (top left corner 1x1 and bottom right corner 1x1 by default).
        /// </summary>
        /// <param name="name">Unique interface identifier</param>
        /// <param name="provider">Tile provider object, default value - null (interface would
        /// be drawn on the Main.tile, tiles would be irrevocably modified).
        /// <para></para>
        /// FakeTileRectangle from [FakeManager](https://github.com/AnzhelikaO/FakeManager)
        /// can be passed as a value so that interface would be drawn above the Main.tile.</param>
        public Panel(string name, int x, int y, int width, int height, PanelDrag drag, PanelResize resize,
                     UIConfiguration configuration = null, ContainerStyle style = null, object provider = null)
            : base(name, x, y, width, height, configuration ?? new UIConfiguration() { UseBegin  = true,
                                                                                       UseMoving = true, UseEnd = true }, style, provider)
        {
            if (drag != null)
            {
                DragObject = Add(drag) as PanelDrag;
            }
            if (resize != null)
            {
                ResizeObject = Add(resize) as PanelResize;
            }

            DBRead();
        }
示例#13
0
        private void LoadConfiguration()
        {
            try
            {
                Configuration = UIConfiguration.Load();
                Logger.Instance.LogFormat(LogType.Info, this, "The UI-configuration was successfully loaded.");
            }
            catch (Exception ex)
            {
                Logger.Instance.LogFormat(LogType.Error, this, "The UI-configuration could not be loaded! Using default configuration.");
                Logger.Instance.LogException(this, ex);

                // Use default configuration
                Configuration = new UIConfiguration();
            }
        }
示例#14
0
        private void LoadConfiguration()
        {
            try
            {
                AlarmWorkflow.Windows.UI.Properties.Settings.Default.Reload();

                Configuration    = new UIConfiguration();
                ExtensionManager = new ExtensionManager();

                Logger.Instance.LogFormat(LogType.Info, this, AlarmWorkflow.Windows.UI.Properties.Resources.UIConfigurationLoaded);
            }
            catch (EndpointNotFoundException ex)
            {
                UIUtilities.ShowError(AlarmWorkflow.Windows.UI.Properties.Resources.UICannotStartWithoutConnectionError);

                Logger.Instance.LogException(this, ex);
                Environment.Exit(1);
            }
            catch (Exception ex)
            {
                Logger.Instance.LogFormat(LogType.Error, this, AlarmWorkflow.Windows.UI.Properties.Resources.UIConfigurationLoadError);
                Logger.Instance.LogException(this, ex);
            }
        }
示例#15
0
文件: Touchable.cs 项目: elfin8er/TUI
 public Touchable(int x, int y, int width, int height, UIConfiguration configuration = null,
         Action<VisualObject, Touch> callback = null)
     : base(x, y, width, height, configuration)
 {
     Callback = callback;
 }
示例#16
0
 public VisualContainer(int x, int y, int width, int height, UIConfiguration configuration = null, ContainerStyle style = null, Action <VisualObject, Touch> callback = null)
     : base(x, y, width, height, configuration, style ?? new ContainerStyle(), callback)
 {
 }
示例#17
0
 public VisualContainer(UIConfiguration configuration)
     : this(0, 0, 0, 0, configuration)
 {
 }
示例#18
0
 public Image(int x, int y, ImageData data, UIConfiguration configuration = null,
              UIStyle style = null, Action <VisualObject, Touch> callback = null)
     : base(x, y, BrokenImageSize, BrokenImageSize, configuration, style, callback)
 {
     Data = data;
 }
示例#19
0
 public Image(int x, int y, string path, UIConfiguration configuration = null,
              UIStyle style = null, Action <VisualObject, Touch> callback = null)
     : base(x, y, BrokenImageSize, BrokenImageSize, configuration, style, callback)
 {
     Path = path;
 }
示例#20
0
 public VisualSign(int x, int y, string text, UIConfiguration configuration = null, UIStyle style = null,
                   Action <VisualObject, Touch> callback = null)
     : this(x, y, 2, 2, text, configuration, style, callback)
 {
 }
示例#21
0
文件: Panel.cs 项目: elfin8er/TUI
 /// <summary>
 /// Root widget that saves its position and size and has a button for changing position
 /// and a button for changing size (top left corner 1x1 and bottom right corner 1x1 by default).
 /// </summary>
 /// <param name="name">Unique interface identifier</param>
 /// <param name="provider">Tile provider object, default value - null (interface would
 /// be drawn on the Main.tile, tiles would be irrevocably modified).
 /// <para></para>
 /// FakeTileRectangle from [FakeManager](https://github.com/AnzhelikaO/FakeManager)
 /// can be passed as a value so that interface would be drawn above the Main.tile.</param>
 public Panel(string name, int x, int y, int width, int height, UIConfiguration configuration = null,
              ContainerStyle style = null, object provider = null)
     : this(name, x, y, width, height, new DefaultPanelDrag(), new DefaultPanelResize(), configuration, style, provider)
 {
 }
示例#22
0
 public void PushUI(UIConfiguration ui, bool clearsStack)
 {
     uiStack.Push(ui);
     ui.LoadUI(GameObject.Find("UI Container"));
 }