Example #1
0
 internal FrmSettings(DesktopClientSettings settings, ExtensionManager extensionManager, StyleManager styleManager)
 {
     InitializeComponent();
     this.settings = settings;
     this.extensionManager = extensionManager;
     this.styleManager = styleManager;
 }
    // ==========================================
    // == Awake
    // ==========================================
    void Awake()
    {
        // get the car controller
        car = GetComponent<CarController>();

        styleManager = GetComponent<StyleManager>();
    }
        /// <summary>
        ///     When overridden in a derived class, allows a designer to emit code that configures the splash screen and main form.
        /// </summary>
        protected override void OnCreateMainForm()
        {
            var extensionManager = new ExtensionManager();
            var styleManager = new StyleManager();

            var settings = DesktopClientSettings.ReadSettings();
            var loadExtensionTask = Task.Factory.StartNew(() =>
            {
                // As the extensions are loaded in another thread, setting that thread's ui culture
                // to the one read from the setting preference.
                Thread.CurrentThread.CurrentUICulture = new CultureInfo(settings.General.Language);
                extensionManager.Load();
            });
            var loadStyleTask = Task.Factory.StartNew(() => styleManager.Load());

            Thread.CurrentThread.CurrentUICulture = new CultureInfo(settings.General.Language);

            var credential = LoginProvider.Login(Application.Exit, settings);
            if (credential != null)
            {
                Task.WaitAll(loadExtensionTask, loadStyleTask);
                // Instantiate your main application form
                this.MainForm = new FrmMain(credential, settings, extensionManager, styleManager);
            }
        }
Example #4
0
        internal FrmMain(ClientCredential credential, DesktopClientSettings settings, ExtensionManager extensionManager, StyleManager styleManager)
        {
            this.credential = credential;

            this.settings = settings;

            this.extensionManager = extensionManager;

            this.styleManager = styleManager;

            this.InitializeComponent();

            this.InitializeHtmlEditor();

            this.InitializeExtensions();

            this.Text = string.Format("CloudNotes - {0}@{1}", credential.UserName, credential.ServerUri);

            // Fix the main form size
            var currentScreen = Screen.FromControl(this);
            this.Width = Convert.ToInt32(currentScreen.Bounds.Width * 0.75F);
            this.Height = Convert.ToInt32(currentScreen.Bounds.Height * 0.75F);
            this.Location = new Point(currentScreen.Bounds.X + (currentScreen.Bounds.Width - this.Width)/2,
                currentScreen.Bounds.Y + (currentScreen.Bounds.Height - this.Height)/2);
            this.splitContainer.SplitterDistance = Convert.ToInt32(this.Width*0.25F);

            this.notifyIcon.Text = string.Format("CloudNotes - {0}", credential.UserName);

            this.notesNode = this.tvNotes.Nodes.Add("NotesRoot", Resources.NotesNodeTitle, 0, 0);
            this.trashNode = this.tvNotes.Nodes.Add("TrashRoot", Resources.TrashNodeTitle, 1, 1);

            Application.Idle += (s, e) => { this.slblStatus.Text = Resources.Ready; };
        }
 public void ChangeColor(int elemNo, StyleManager.BaseColor color)
 {
     itemsToColor [elemNo].color = color;
     foreach (Elem e in itemsToColor) {
         if(e.whatToColor != null)
             e.whatToColor.color = StyleManager.Instance.GetColor (e.color);
     }
 }
Example #6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // Load the CSS file
            var style = File.ReadAllText ("StyleOne.css");
            TextStyle.Instance.SetCSS (style);

            // Create a StyleManager to handle any CSS changes automatically
            _styleManager = new StyleManager ();
            _styleManager.Add (labelOne, "h2", headingOne);
            _styleManager.Add (labelTwo, "h1", headingTwo);
            _styleManager.Add (labelThree, "h2", headingThree, new List<CssTagStyle> {
                new CssTagStyle ("spot"){ CSS = "spot{color:" + Colors.SpotColor.ToHex () + "}" }
            });
            _styleManager.Add (body, "body", textBody);

            AddUIElements ();
        }
Example #7
0
        public Drawing(Canvas canvas)
        {
            Check.NotNull(canvas, "canvas");

            ActionManager = new ActionManager();
            StyleManager = new StyleManager(this);

            Figures = new RootFigureList(this);

            OnAttachToCanvas += Drawing_OnAttachToCanvas;
            OnDetachFromCanvas += Drawing_OnDetachFromCanvas;

            Canvas = canvas;

            CoordinateSystem = new CoordinateSystem(this);
            CoordinateGrid = new CartesianGrid() { Drawing = this, Visible = Settings.Instance.ShowGrid };
            Figures.Add(CoordinateGrid);
            Version = Settings.CurrentDrawingVersion;
        }
Example #8
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Tiling" /> class.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="definition">The definition.</param>
        /// <param name="tiles">The tiles.</param>
        /// <param name="styleManager">The style manager.</param>
        /// <exception cref="System.ArgumentNullException">
        /// </exception>
        public Tiling(
            [NotNull] Template template,
            [NotNull] TilingDefinition definition,
            [NotNull] IReadOnlyList<Tile> tiles,
            [NotNull] StyleManager styleManager)
        {
            if (template == null) throw new ArgumentNullException(nameof(template));
            if (definition == null) throw new ArgumentNullException(nameof(definition));
            if (tiles == null) throw new ArgumentNullException(nameof(tiles));
            if (styleManager == null) throw new ArgumentNullException(nameof(styleManager));

            _styleManager = styleManager;
            Template = template;
            Definition = definition;
            Tiles = tiles;

            foreach (Tile tile in tiles)
            {
                foreach (EdgePartShape part in tile.PartShapes)
                    _tileByEdgePart.Add(part.Part, tile);
            }
        }
        private void ThemeChanged(string param)
        {
            switch (param)
            {
            case "Metro":
                StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.DarkBlue;
                StyleManager.Style = eStyle.Metro;     // BOOM
                break;

            case "Office2007Blue":
            case "Office2007Silver":
            case "Office2007Black":
            case "Office2007VistaGlass":
            case "Office2010Silver":
            case "Office2010Blue":
            case "Office2010Black":
            case "Windows7Blue":
            case "VisualStudio2010Blue":
                eStyle style = (eStyle)Enum.Parse(typeof(eStyle), param);
                StyleManager.ChangeStyle(style, Color.Empty);
                break;

            default:
                if (param.StartsWith("#"))
                {
                    string colorstr            = param.TrimStart('#');
                    System.Drawing.Color color = System.Drawing.Color.FromArgb(Convert.ToInt32(colorstr, 16));
                    if (StyleManager.Style == eStyle.Metro)
                    {
                        StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Color.White, color);
                    }
                    else
                    {
                        StyleManager.ColorTint = color;
                    }
                }
                break;
            }
        }
Example #10
0
        public ScriptEditView(PluginMain main, bool highlight = false)
        {
            InitializeComponent();

            InitializeAutoComplete();

            Icon = Icon.FromHandle(Resources.ScriptIcon.GetHicon());

            _main      = main;
            _quickFind = new QuickFind(this, _codeBox);

            _codeBox.BorderStyle = BorderStyle.None;
            _codeBox.Dock        = DockStyle.Fill;
            _codeBox.Styles[Style.Default].Font      = StyleManager.Style.FixedFont.Name;
            _codeBox.Styles[Style.Default].SizeF     = StyleManager.Style.FixedFont.Size;
            _codeBox.Styles[Style.Default].ForeColor = StyleManager.Style.TextColor;
            _codeBox.Styles[Style.Default].BackColor = StyleManager.Style.BackColor;
            _codeBox.StyleClearAll();
            _codeBox.CharAdded        += codeBox_CharAdded;
            _codeBox.InsertCheck      += codeBox_InsertCheck;
            _codeBox.KeyDown          += codebox_KeyDown;
            _codeBox.MarginClick      += codeBox_MarginClick;
            _codeBox.SavePointLeft    += codeBox_SavePointLeft;
            _codeBox.SavePointReached += codeBox_SavePointReached;
            _codeBox.TextChanged      += codeBox_TextChanged;
            _codeBox.UpdateUI         += codeBox_UpdateUI;
            Controls.Add(_codeBox);

            InitializeMargins();
            if (highlight)
            {
                _codeBox.Lexer = Lexer.Cpp;
                InitializeHighlighting("");
                InitializeFolding();
            }

            StyleManager.AutoStyle(this);
        }
Example #11
0
        private void menuStyle_Click(object sender, EventArgs e)
        {
            var styleClickedItem = (ToolStripMenuItem)sender;
            var currentStyle     = styleManager1.ManagerStyle;

            if (styleClickedItem.Tag.ToString() == "customerColor")
            {
                if (colorDialog1.ShowDialog() == DialogResult.OK)
                {
                    var color = colorDialog1.Color;
                    if (StyleManager.IsMetro(currentStyle))
                    {
                        StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Color.White, color);
                    }
                    else
                    {
                        StyleManager.ColorTint = color;
                    }
                    //StyleManager.ChangeStyle(currentStyle, color);
                    _theme.EStyle   = currentStyle;
                    _theme.Color    = color.Name;
                    _theme.Tag      = styleClickedItem.Tag.ToString();
                    _theme.Customer = true;
                    LocalConfig.SaveTheme(_theme);
                }
            }
            else
            {
                styleItems[currentStyle.ToString()].Checked = false;
                styleClickedItem.Checked   = true;
                styleManager1.ManagerStyle = (eStyle)Enum.Parse(typeof(eStyle), styleClickedItem.Tag.ToString());
                _theme.EStyle = styleManager1.ManagerStyle;
                styleManager1.ManagerColorTint = Color.FromName("0");
                _theme.Customer = false;
                _theme.Tag      = styleClickedItem.Tag.ToString();
                LocalConfig.SaveTheme(_theme);
            }
        }
Example #12
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BaseRibbonForm));
     this.styleManager1 = new DevComponents.DotNetBar.StyleManager(this.components);
     this.comboItem1    = new DevComponents.Editors.ComboItem();
     this.comboItem2    = new DevComponents.Editors.ComboItem();
     this.SuspendLayout();
     //
     // styleManager1
     //
     this.styleManager1.ManagerStyle         = DevComponents.DotNetBar.eStyle.Office2010Blue;
     this.styleManager1.MetroColorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(System.Drawing.Color.White, System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(163)))), ((int)(((byte)(26))))));
     //
     // comboItem1
     //
     this.comboItem1.Text = "comboItem1";
     //
     // comboItem2
     //
     this.comboItem2.Text = "comboItem2";
     //
     // BaseRibbonForm
     //
     this.BackColor             = System.Drawing.SystemColors.Window;
     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.ClientSize            = new System.Drawing.Size(616, 375);
     this.Font          = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.KeyPreview    = true;
     this.Name          = "BaseRibbonForm";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "基类窗口";
     this.FormClosed   += new System.Windows.Forms.FormClosedEventHandler(this.BaseForm_FormClosed);
     this.Load         += new System.EventHandler(this.Form_Load);
     this.KeyDown      += new System.Windows.Forms.KeyEventHandler(this.Form_KeyDown);
     this.ResumeLayout(false);
 }
Example #13
0
    private void Start()
    {
        Application.targetFrameRate = 60;
        saveLoadManager             = GetComponentInChildren <SaveLoadManager>();
        savedData = saveLoadManager.LoadData();
        shopSectionManager.Init(savedData);
        styleManager = GetComponentInChildren <StyleManager>();
        styleManager.Init(savedData);
        playStoreManager = GetComponentInChildren <PlayStoreManager>();
        playStoreManager.Init();
        achievementManager = GetComponentInChildren <AchievementManager>();
        soundManager       = GetComponentInChildren <SoundManager>();
        soundManager.Init(saveLoadManager);
        totalScoreWaitForFixedUpdate = new WaitForFixedUpdate();

        selectedPurchaseableIndex = 0;
        selectedSectionIndex      = -1;
        totalScoreText.text       = savedData.totalScore.ToString().PadLeft(padLeftAmount, padChar);
        hatPreviewModels[(int)savedData.GetSelectedHatType()].SetActive(true);
        shopSectionManager.PurchaseableSelected(selectedSectionIndex, (int)savedData.GetSelectedHatType());
        ShowSection(0);
        CheckAchievementConditions();
    }
Example #14
0
        /// <summary>
        /// 设置各个控件的初始信息和状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LoadComponentData(object sender, EventArgs e)
        {
            LoadInstalledFonts();
            StyleManager.LoadStylePreset(presetDirPath);
            presetListCmbox.Items.AddRange(StyleManager.PresetList.ToArray());

            try
            {
                // 加载时预设不为空,默认加载第一个
                if (StyleManager.PresetList.Count > 0)
                {
                    presetListCmbox.SelectedIndex = 0;
                    var curGroup = (StyleGroup)presetListCmbox.SelectedItem;
                    styleListBox.Items.AddRange(curGroup.styles);
                    styleListBox.SelectedIndex = 0;
                }
                autoLineSpacingTip.SetToolTip(autoLineSpaceRadioBtn, "设置n倍行距,如1倍、1.15倍和2倍行距等");
            }
            catch (Exception)
            {
                MessageBox.Show("预设文件异常!");
            }
        }
Example #15
0
        private void Align()
        {
            float x = GlobalPosition.X;
            float y = GlobalPosition.Y;

            float lineSpacing = Font.GetLineSpacing(StyleManager.GetUint("font-size"));

            foreach (var letter in _letters)
            {
                if (letter.IsNewLine)
                {
                    y += lineSpacing;
                    x  = GlobalPosition.X;
                }

                letter.Position = new Vector2i((int)x, (int)y);

                if (!letter.IsNewLine)
                {
                    x += letter.Advance;
                }
            }
        }
Example #16
0
 private void buttonStyleCustom_ExpandChange(object sender, System.EventArgs e)
 {
     if (buttonStyleCustom.Expanded)
     {
         // Remember the starting color scheme to apply if no color is selected during live-preview
         m_ColorSelected = false;
         m_BaseStyle     = StyleManager.Style;
     }
     else
     {
         if (!m_ColorSelected)
         {
             if (StyleManager.IsMetro(StyleManager.Style))
             {
                 StyleManager.MetroColorGeneratorParameters = DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters.Default;
             }
             else
             {
                 StyleManager.ChangeStyle(m_BaseStyle, Color.Empty);
             }
         }
     }
 }
Example #17
0
        public Loader(Task waitTask, Color pcColor, string title = "Loading")
        {
            InitializeComponent();

            SetupProgressBar(pcColor);

            lblLoad.Text = title;

            Icon = Resources.OpenFL_Icon;

            CheckForIllegalCrossThreadCalls = false;
            WaitTask = waitTask;


            StyleManager.RegisterControls(this, "loader");

            //FLScriptEditor.RegisterDefaultTheme(rtbLog);
            //FLScriptEditor.RegisterDefaultTheme(panelLog);
            //FLScriptEditor.RegisterDefaultTheme(pbProgress);
            //FLScriptEditor.RegisterDefaultTheme(lblStatus);
            //FLScriptEditor.RegisterDefaultTheme(lblLoad);
            //FLScriptEditor.RegisterDefaultTheme(panel1);
        }
Example #18
0
        public void UpdateTheme(Theme theme)
        {
            try
            {
                _styleManager = new StyleManager(theme);

                BackColor          = theme.ColorPalette.FormBackground;
                _border.Color      = theme.ColorPalette.BorderNormal;
                _border.HoverColor = theme.ColorPalette.BorderHover;
                ForeColor          = theme.ColorPalette.TextEnabled;
                _titleForeColor    = theme.ColorPalette.TextEnabled;
                _windowBarColor    = theme.ColorPalette.FormWindowBar;

                // Update internal controls.
                ControlBox.UpdateTheme(theme);
            }
            catch (Exception e)
            {
                Logger.WriteDebug(e);
            }

            OnThemeChanged(this, new ThemeEventArgs(theme));
        }
Example #19
0
    public override void Init(GeoCamera camera)
    {
        base.Init(camera);

        geoCamera.OnRotate += OnCameraRotate;

        lines = new GameObject[COUNT];
        dirs  = new Vector3[COUNT];

        for (int i = 0; i < COUNT; i++)
        {
            MeshRenderer mr;
            GameObject   line = InitLine(i, out mr);
            lines[i] = line;

            StyleManager.SetGizmosLineMaterial(mr);

            StyleManager.OnStyleChange += () =>
            {
                StyleManager.SetGizmosLineMaterial(mr);
            };
        }
    }
Example #20
0
    private void Start()
    {
        saveLoadManager = GetComponentInChildren <SaveLoadManager>();
        savedData       = saveLoadManager.LoadData();

        fruitSpawner = GetComponentInChildren <FruitSpawner>();
        if (saveLoadManager.GetTutorialStatus())
        {
            fruitSpawner.Init();
        }
        scoreManager = GetComponentInChildren <ScoreManager>();
        scoreManager.Init(savedData);
        guiManager = GetComponentInChildren <GuiManager>();
        guiManager.Init(saveLoadManager);
        powerupSpawner = GetComponentInChildren <PowerupSpawner>();
        powerupSpawner.Init(savedData);
        cameraController.Init();
        styleManager = GetComponentInChildren <StyleManager>();
        styleManager.Init(savedData);
        soundManager = GetComponentInChildren <SoundManager>();
        soundManager.Init(saveLoadManager);
        soundManager.PlaySound(SoundEffectType.SOUND_SLITHER, false);
    }
Example #21
0
        private static void CreateAxis()
        {
#if !DEBUG
            ModPlusAPI.Statistic.SendCommandStarting(
                Axis.GetDescriptor().Name, ModPlusConnector.Instance.AvailProductExternalVersion);
#endif
            try
            {
                Overrule.Overruling = false;

                /* Регистрация ЕСКД приложения должна запускаться при запуске
                 * функции, т.к. регистрация происходит в текущем документе
                 * При инициализации плагина регистрации нет!
                 */
                ExtendedDataUtils.AddRegAppTableRecord(Axis.GetDescriptor());

                var style = StyleManager.GetCurrentStyle(typeof(Axis));

                var axisLastHorizontalValue = string.Empty;
                var axisLastVerticalValue   = string.Empty;
                FindLastAxisValues(ref axisLastHorizontalValue, ref axisLastVerticalValue);
                var axis = new Axis(axisLastHorizontalValue, axisLastVerticalValue);

                var blockReference = MainFunction.CreateBlock(axis);
                axis.ApplyStyle(style, true);

                InsertAxisWithJig(axis, blockReference);
            }
            catch (Exception exception)
            {
                ExceptionBox.Show(exception);
            }
            finally
            {
                Overrule.Overruling = true;
            }
        }
Example #22
0
        public override void Update()
        {
            base.Update();

            _bar.Position = (Vector2f)GlobalPosition + new Vector2f(0, (int)(Size.Y / 2f));
            _bar.Size     = new Vector2f(Size.X, 2);

            _valueBar.Position = (Vector2f)GlobalPosition + new Vector2f(0, (int)(Size.Y / 2f));
            _valueBar.Size     = new Vector2f(_currentOffset, 2);

            if (_active == true)
            {
                int offset = Mouse.GetPosition(Form.Window).X - GlobalPosition.X;
                offset         = setOffsetInbounds(offset);
                _currentOffset = offset;
                Value          = OffsetToValue(_currentOffset);
            }
            else
            {
                _currentOffset = ValueToOffset(Value);
            }

            _pointer.Position = new Vector2f(GlobalPosition.X + _currentOffset - _pointer.Radius, _bar.Position.Y - _pointer.Radius + 1);

            if (Hovered || _active)
            {
                _pointer.OutlineColor = StyleManager.GetColor("accent-color");
            }
            else
            {
                _pointer.OutlineColor = StyleManager.GetColor("secondary-color");
            }

            _bar.FillColor      = StyleManager.GetColor("secondary-color");
            _valueBar.FillColor = StyleManager.GetColor("accent-color");
            _pointer.FillColor  = StyleManager.GetColor("primary-color");
        }
        /// <summary>Initializes a new instance of the <see cref="VisualTabControl" /> class.</summary>
        public VisualTabControl()
        {
            SetStyle(
                ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
                ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.SupportsTransparentBackColor,
                true);

            UpdateStyles();

            _styleManager = new StyleManager(Settings.DefaultValue.DefaultStyle);

            _border = new Border
            {
                Type = ShapeType.Rectangle
            };

            _alignment         = TabAlignment.Top;
            _selectorVisible   = true;
            _selectorSpacing   = 10;
            _selectorThickness = 5;
            _selectorAlignment = TabAlignment.Bottom;

            _itemSize         = new Size(100, 25);
            _tabMenu          = Color.FromArgb(55, 61, 73);
            _tabSelector      = _styleManager.Theme.BackgroundSettings.Type4;
            _textRendererHint = Settings.DefaultValue.TextRenderingHint;

            _separatorSpacing   = 2;
            _separatorThickness = 2F;
            _separator          = _styleManager.Theme.OtherSettings.Line;
            _selectorTypes      = SelectorTypes.Arrow;

            Size     = new Size(320, 160);
            DrawMode = TabDrawMode.OwnerDrawFixed;
            ItemSize = _itemSize;
        }
Example #24
0
        public InstructionViewerForm(FLInstructionSet instructionSet)
        {
            InstructionSet = new List <FLInstructionCreator>();

            InstructionKeys = instructionSet.GetInstructionNames().ToList();


            for (int i = 0; i < instructionSet.CreatorCount; i++)
            {
                InstructionSet.Add(instructionSet.GetCreatorAt(i));
            }


            InitializeComponent();
            Text = $"Viewing {InstructionKeys.Count} Instructions";
            Icon = FLEditorPluginHost.FLEditorIcon;

            StyleManager.RegisterControls(this);

            //FLScriptEditor.RegisterDefaultTheme(panelInstructions);
            //FLScriptEditor.RegisterDefaultTheme(gbInstructions);
            //FLScriptEditor.RegisterDefaultTheme(lbInstructions);
            //FLScriptEditor.RegisterDefaultTheme(panelMainInstructionView);
            //FLScriptEditor.RegisterDefaultTheme(panelOverloads);
            //FLScriptEditor.RegisterDefaultTheme(gbOverloads);
            //FLScriptEditor.RegisterDefaultTheme(lbOverloads);
            //FLScriptEditor.RegisterDefaultTheme(panelHeaderInfo);
            //FLScriptEditor.RegisterDefaultTheme(lblInstructionName);
            //FLScriptEditor.RegisterDefaultTheme(panelLegend);
            //FLScriptEditor.RegisterDefaultTheme(gbLegend);
            //FLScriptEditor.RegisterDefaultTheme(lbLegend);
            //FLScriptEditor.RegisterDefaultTheme(panelInstructionInfo);
            //FLScriptEditor.RegisterDefaultTheme(panelInstructionDescription);
            //FLScriptEditor.RegisterDefaultTheme(gbInstructionDescription);
            //FLScriptEditor.RegisterDefaultTheme(rtbInstructionDescription);
            //FLScriptEditor.RegisterDefaultTheme(panelInstructionName);
        }
Example #25
0
        /// <summary>
        /// Method that is called when the Reset Button is clicked
        /// </summary>
        /// <param name="sender">The object that called this method</param>
        /// <param name="e">The RoutedEventArgs</param>
        private void BtnReset_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (MessageBox.Show("Are you sure you want to reset all settings?", "Advanced PortChecker", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
                {
                    return;
                }

                Properties.Settings.Default.Reset();
                Properties.Settings.Default.Save();

                LoadSettings();

                _mw.WindowDraggable();

                StyleManager.ChangeStyle(_mw);
                StyleManager.ChangeStyle(this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Advanced PortChecker", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #26
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Tiling" /> class.
        /// </summary>
        /// <param name="template">The template.</param>
        /// <param name="definition">The definition.</param>
        /// <param name="tiles">The tiles.</param>
        /// <param name="styleManager">The style manager.</param>
        /// <exception cref="System.ArgumentNullException">
        /// </exception>
        public Tiling(
            [NotNull] Template template,
            [NotNull] TilingDefinition definition,
            [NotNull] IReadOnlyList <Tile> tiles,
            [NotNull] StyleManager styleManager)
        {
            if (template == null)
            {
                throw new ArgumentNullException(nameof(template));
            }
            if (definition == null)
            {
                throw new ArgumentNullException(nameof(definition));
            }
            if (tiles == null)
            {
                throw new ArgumentNullException(nameof(tiles));
            }
            if (styleManager == null)
            {
                throw new ArgumentNullException(nameof(styleManager));
            }

            _styleManager = styleManager;
            Template      = template;
            Definition    = definition;
            Tiles         = tiles;

            foreach (Tile tile in tiles)
            {
                foreach (EdgePartShape part in tile.PartShapes)
                {
                    _tileByEdgePart.Add(part.Part, tile);
                }
            }
        }
Example #27
0
        protected override void RunCallback()
        {
            var dbFactory           = new DbFactory();
            var time                = new TimeService(dbFactory);
            var log                 = GetLogger();
            var settings            = new SettingsService(dbFactory);
            var styleHistoryService = new StyleHistoryService(log, time, dbFactory);
            var styleManager        = new StyleManager(log, time, styleHistoryService);

            var lastSyncDate = settings.GetListingsQuantityToAmazonSyncDate(_api.Market, _api.MarketplaceId);

            LogWrite("Last sync date=" + lastSyncDate);

            if (!lastSyncDate.HasValue ||
                (time.GetUtcTime() - lastSyncDate) > _betweenProcessingInverval)
            {
                var sync = new DSItemsSync(log,
                                           time,
                                           _api,
                                           dbFactory);
                sync.SendInventoryUpdates();
                settings.SetListingsQuantityToAmazonSyncDate(time.GetUtcTime(), _api.Market, _api.MarketplaceId);
            }
        }
        public ActionResult SaveStyle(Style_Model objModel, int page = 1, int pageSize = 5)
        {
            if (!ModelState.IsValid)
            {
                var message = string.Join("|", ModelState.Values.SelectMany(e => e.Errors).Select(em => em.ErrorMessage));
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, message));
            }
            int OPM_ID = objModel.Table.OPM_ID != null ? objModel.Table.OPM_ID.Value : 0;
            //Save
            StyleManager context = new StyleManager(new DataContext());
            var          msg     = context.SaveStyle(objModel.Table);

            if (msg.Contains("exists"))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "exists"));
            }
            else
            {
                objModel.OPM_ID = OPM_ID;
                BindStyleGrid(objModel, page, pageSize);
                string vwString = HtmlHelpers.RenderViewToString(this.ControllerContext, "StyleList", objModel);
                return(Json(new { OPM_ID = OPM_ID, viewData = vwString }));
            }
        }
Example #29
0
        internal FrmMain(ClientCredential credential, DesktopClientSettings settings, ExtensionManager extensionManager, StyleManager styleManager)
        {
            this.credential = credential;

            this.settings = settings;

            this.extensionManager = extensionManager;

            this.styleManager = styleManager;

            this.InitializeComponent();

            this.InitializeHtmlEditor();

            this.InitializeExtensions();

            this.Text = string.Format("CloudNotes - {0}@{1}", credential.UserName, credential.ServerUri);

            // Fix the main form size
            var currentScreen = Screen.FromControl(this);

            this.Width    = Convert.ToInt32(currentScreen.Bounds.Width * 0.75F);
            this.Height   = Convert.ToInt32(currentScreen.Bounds.Height * 0.75F);
            this.Location = new Point(currentScreen.Bounds.X + (currentScreen.Bounds.Width - this.Width) / 2,
                                      currentScreen.Bounds.Y + (currentScreen.Bounds.Height - this.Height) / 2);
            this.splitContainer.SplitterDistance = Convert.ToInt32(this.Width * 0.25F);

            this.notifyIcon.Text = string.Format("CloudNotes - {0}", credential.UserName);

            this.notesNode = this.tvNotes.Nodes.Add("NotesRoot", Resources.NotesNodeTitle, 0, 0);
            this.trashNode = this.tvNotes.Nodes.Add("TrashRoot", Resources.TrashNodeTitle, 1, 1);

            this.slblStatus.Text = Resources.Ready;

            // Application.Idle += (s, e) => { this.slblStatus.Text = Resources.Ready; };
        }
Example #30
0
        /// <summary>Initializes a new instance of the <see cref="VisualRichTextBox" /> class.</summary>
        public VisualRichTextBox()
        {
            SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);

            // Contains another control
            SetStyle(ControlStyles.ContainerControl, true);

            // Cannot select this control, only the child and does not generate a click event
            SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);

            _border = new Border();

            ThemeManager    = new StyleManager(Settings.DefaultValue.DefaultStyle);
            _backColorState = new ColorState
            {
                Enabled = ThemeManager.Theme.BackgroundSettings.Type4
            };

            _richTextBox = new RichTextBox
            {
                Size        = GetInternalControlSize(Size, _border),
                Location    = GetInternalControlLocation(_border),
                Text        = string.Empty,
                BorderStyle = BorderStyle.None,
                Font        = Font,
                ForeColor   = ForeColor,
                BackColor   = _backColorState.Enabled,
                Multiline   = true
            };

            Size = new Size(150, 100);

            Controls.Add(_richTextBox);

            UpdateTheme(ThemeManager.Theme);
        }
        /// <summary>
        /// The event will be triggered when themeButton clicked.
        /// </summary>
        /// <param name="source">mResetButton.</param>
        /// <param name="e">event</param>
        /// <returns>The consuming flag.</returns>
        private bool OnThemeButtonClicked(object source, EventArgs e)
        {
            PushButton button = source as PushButton;

            // Judge which style button is clicked.
            if (button.LabelText == "DefaultTheme")
            {
                Tizen.Log.Fatal("NUI", "Change the theme to Default: " + defaultThemePath);
                themePath = defaultThemePath;
            }
            else if (button.LabelText == "CustomTheme")
            {
                Tizen.Log.Fatal("NUI", "Change the theme to Custom: " + customThemePath);
                themePath = customThemePath;
            }
            // Change the style.
            StyleManager.Get().ApplyTheme(themePath);
            PropertyMap _focusText = CreateTextVisual(button.LabelText, Color.Black);
            PropertyMap focusMap   = CreateImageVisual(focusImagePath);

            button.UnselectedBackgroundVisual = focusMap;
            button.Label = _focusText;
            return(true);
        }
Example #32
0
 public UiManager()
 {
     _activeScreens = new List<Screen>();
     _mousePointer = new MousePointer();
     StyleManager = new StyleManager();
 }
Example #33
0
 internal ExcelSunburstChart(ExcelDrawings drawings, XmlNode drawingsNode, eChartType?type, XmlDocument chartXml = null, ExcelGroupShape parent = null) :
     base(drawings, drawingsNode, type, chartXml, parent)
 {
     StyleManager.SetChartStyle(Chart.Style.ePresetChartStyle.SunburstChartStyle1);
 }
        /// <summary>
        /// Script Layout Sample Application initialization.
        /// </summary>
        private void Initialize()
        {
            //Window.Instance.BackgroundColor = new Color(0.9f, 0.9f, 0.9f, 1.0f);
            Window.Instance.BackgroundColor = Color.Black;
            //Window.Instance.BackgroundColor = Color.White;
            View focusIndicator = new View();

            FocusManager.Instance.FocusIndicator = focusIndicator;
            themePath = defaultThemePath;

            // Applies a new theme to the application.
            // This will be merged on top of the default Toolkit theme.
            // If the application theme file doesn't style all controls that the
            // application uses, then the default Toolkit theme will be used
            // instead for those controls.
            StyleManager.Get().ApplyTheme(defaultThemePath);
            //Create the title
            guide                        = new TextLabel();
            guide.StyleName              = "Title";
            guide.HorizontalAlignment    = HorizontalAlignment.Center;
            guide.VerticalAlignment      = VerticalAlignment.Center;
            guide.PositionUsesPivotPoint = true;
            guide.ParentOrigin           = ParentOrigin.TopLeft;
            guide.PivotPoint             = PivotPoint.TopLeft;
            guide.Size2D                 = new Size2D(1920, 96);
            guide.FontFamily             = "Samsung One 600";
            guide.Position2D             = new Position2D(0, 94);
            guide.MultiLine              = false;
            //guide.PointSize = 15.0f;
            guide.PointSize       = DeviceCheck.PointSize15;
            guide.Text            = "Script Sample \n";
            guide.TextColor       = Color.White;
            guide.BackgroundColor = Color.Black;//new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
            Window.Instance.GetDefaultLayer().Add(guide);

            //The container of the RadioButtons, CheckBoxButtons, Sliders, and the big ImageView
            TableView content = new TableView(6, 6);

            //content.BackgroundColor = Color.Black;
            content.Position2D             = new Position2D(100, 275);
            content.Size2D                 = new Size2D(1000, 500);
            content.PositionUsesPivotPoint = true;
            content.ParentOrigin           = ParentOrigin.TopLeft;
            content.PivotPoint             = PivotPoint.TopLeft;
            content.CellPadding            = new Vector2(0, 5);
            for (uint i = 0; i < content.Rows; ++i)
            {
                content.SetFitHeight(i);
            }

            for (uint i = 0; i < content.Columns; ++i)
            {
                content.SetFitWidth(i);
            }

            Window.Instance.GetDefaultLayer().Add(content);
            string[] images = { smallImage1, smallImage2, smallImage3 };
            mRadioButtons = new RadioButton[3];
            for (uint i = 0; i <= 2; i++)
            {
                ImageView image = new ImageView(images[i]);
                image.Name   = "thumbnail" + (i + 1);
                image.Size2D = new Size2D(60, 60);

                mRadioButtons[i] = CreateRadioButton((i + 1).ToString());

                if (DeviceCheck.IsSREmul())
                {
                    mRadioButtons[i].StyleName = "RadioButton";
                }
                else
                {
                    mRadioButtons[i].StyleName = "TVRadioButton";
                }
                content.AddChild(mRadioButtons[i], new TableView.CellPosition(i, 0));
                content.AddChild(image, new TableView.CellPosition(i, 1));
                content.SetCellAlignment(new TableView.CellPosition(i, 0), HorizontalAlignmentType.Left, VerticalAlignmentType.Center);
                content.SetCellAlignment(new TableView.CellPosition(i, 1), HorizontalAlignmentType.Left, VerticalAlignmentType.Center);
            }

            mRadioButtons[0].Selected = true;
            //Set the focus to the first radioButton when the apps loaded
            FocusManager.Instance.SetCurrentFocusView(mRadioButtons[0]);

            string[] checkboxLabels = { "R", "G", "B" };
            mCheckButtons   = new CheckBoxButton[3];
            mChannelSliders = new Slider[3];
            for (uint i = 3; i <= 5; i++)
            {
                mCheckButtons[i - 3]          = CreateCheckBox(checkboxLabels[i - 3]);
                mCheckButtons[i - 3].Selected = true;
                mCheckButtons[i - 3].Name     = "channelActiveCheckBox" + (i - 2).ToString();
                mChannelSliders[i - 3]        = CreateSlider();
                mChannelSliders[i - 3].Name   = "ColorSlider" + (i - 2);
                mChannelSliders[i - 3].Size2D = new Size2D(800, 80);
                // Set the current value of mChannelSliders;
                mChannelSliders[i - 3].KeyEvent     += ChannelSliderKeyEvent;
                mChannelSliders[i - 3].ValueChanged += OnSliderChanged;

                // Set the style according to the target devices
                if (DeviceCheck.IsSREmul())
                {
                    mCheckButtons[i - 3].StyleName = "CheckBoxButton";
                }
                else
                {
                    mCheckButtons[i - 3].StyleName = "TVCheckBoxButton";
                }

                content.AddChild(mCheckButtons[i - 3], new TableView.CellPosition(i, 0));
                content.AddChild(mChannelSliders[i - 3], new TableView.CellPosition(i, 1));
                content.SetCellAlignment(new TableView.CellPosition(i, 0), HorizontalAlignmentType.Left, VerticalAlignmentType.Center);
                content.SetCellAlignment(new TableView.CellPosition(i, 1), HorizontalAlignmentType.Left, VerticalAlignmentType.Center);
            }

            mImagePlacement        = new ImageView(bigImage1);
            mImagePlacement.Size2D = new Size2D(500, 500);
            mImagePlacement.PositionUsesPivotPoint = true;
            mImagePlacement.PivotPoint             = PivotPoint.TopLeft;
            mImagePlacement.ParentOrigin           = ParentOrigin.TopLeft;
            mImagePlacement.Position2D             = new Position2D(1320, 230);
            Window.Instance.GetDefaultLayer().Add(mImagePlacement);

            defaultThemeButton            = CreateButton("DefaultTheme", "DefaultTheme", new Size2D(400, 80));
            defaultThemeButton.Position2D = new Position2D(373, 900);
            defaultThemeButton.Clicked   += OnThemeButtonClicked;
            Window.Instance.GetDefaultLayer().Add(defaultThemeButton);
            customThemeButton            = CreateButton("CustomTheme", "CustomTheme", new Size2D(400, 80));
            customThemeButton.Position2D = new Position2D(1146, 900);
            customThemeButton.Clicked   += OnThemeButtonClicked;
            Window.Instance.GetDefaultLayer().Add(customThemeButton);

            if (DeviceCheck.IsSREmul())
            {
                defaultThemeButton.StyleName = "PushButton";
                customThemeButton.StyleName  = "PushButton";
            }
            else
            {
                defaultThemeButton.StyleName = "TVPushButton";
                customThemeButton.StyleName  = "TVPushButton";
            }

            defaultThemeButton.RightFocusableView = customThemeButton;
            customThemeButton.LeftFocusableView   = defaultThemeButton;
            defaultThemeButton.UpFocusableView    = mCheckButtons[2];
            mCheckButtons[2].DownFocusableView    = defaultThemeButton;
            customThemeButton.UpFocusableView     = mChannelSliders[2];
            Window.Instance.KeyEvent += AppBack;
        }
Example #35
0
 /// <summary>
 ///     Applies the KSP theme to a game object and its children.
 /// </summary>
 public void ApplyTheme(GameObject gameObject)
 {
     StyleManager.Process(gameObject);
 }
Example #36
0
        /// <summary>Initializes a new instance of the <see cref="VisualTextBox" /> class.</summary>
        public VisualTextBox()
        {
            SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);

            // Contains another control
            SetStyle(ControlStyles.ContainerControl, true);

            // Cannot select this control, only the child and does not generate a click event
            SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick, false);

            _borderButton = new BorderEdge {
                Visible = false
            };

            _borderImage = new BorderEdge {
                Visible = false
            };

            _textWidth = GetTextBoxWidth();
            _border    = new Border();

            ThemeManager = new StyleManager(Settings.DefaultValue.DefaultStyle);

            _backColorState = new ColorState {
                Enabled = ThemeManager.Theme.ColorPalette.ControlEnabled
            };

            _textBox = new TextBoxExtended
            {
                Size        = new Size(125, 25),
                Location    = new Point(_border.BorderCurve, _border.BorderCurve),
                Text        = string.Empty,
                BorderStyle = BorderStyle.None,
                TextAlign   = HorizontalAlignment.Left,
                Font        = Font,
                ForeColor   = ForeColor,
                BackColor   = _backColorState.Enabled,
                Multiline   = false
            };

            _imageWidth   = 35;
            _buttonFont   = Font;
            _buttonIndent = 3;
            _buttontext   = "visualButton";

            _image     = null;
            _imageSize = new Size(16, 16);

            _watermark    = new Watermark();
            _buttonBorder = new Border();

            _textBox.KeyDown     += TextBox_KeyDown;
            _textBox.Leave       += OnLeave;
            _textBox.Enter       += OnEnter;
            _textBox.GotFocus    += OnEnter;
            _textBox.LostFocus   += OnLeave;
            _textBox.MouseLeave  += OnLeave;
            _textBox.TextChanged += TextBox_TextChanged;
            _textBox.SizeChanged += TextBox_SizeChanged;

            Controls.Add(_textBox);
            Controls.Add(_borderButton);
            Controls.Add(_borderImage);

            _waterMarkContainer = null;

            Size = new Size(135, 25);

            if (_watermark.Visible)
            {
                DrawWaterMark();
            }

            UpdateTheme(ThemeManager.Theme);
        }
Example #37
0
 /// <summary>
 /// This method should be overridden by deriving classes requiring notifications when the style changes.
 /// </summary>
 /// <param name="styleManager">The StyleManager object.</param>
 /// <param name="change">Information denoting what has changed.</param>
 /// <since_tizen> 3 </since_tizen>
 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
 {
 }
Example #38
0
 /// <summary>
 /// Change the visual style of the controls, depending on the settings.
 /// </summary>
 private void ChangeVisualStyle()
 {
     _logController.AddLog(new ApplicationLog("Changing AboutWindow theme style"));
     StyleManager.ChangeStyle(this);
     _logController.AddLog(new ApplicationLog("Done changing AboutWindow theme style"));
 }
Example #39
0
 /// <summary>
 /// Default constructor
 /// The data context of the dialog is set to itself
 /// </summary>
 public RadMessageBox()
 {
     StyleManager.SetTheme(this, App.Theme);
     InitializeComponent();
     this.DataContext = this;
 }
 public BuildMessageWarningClassifierFormat(StyleManager styleManager)
     : base(styleManager)
 {
     // TODO: Move to resources
     DisplayName = "Build warning message";
 }
 public BuildResultSucceededClassifierFormat(StyleManager styleManager)
     : base(styleManager)
 {
     // TODO: Move to resources
     DisplayName = "Build succeeded";
 }
 public BuildMessageErrorClassifierFormat(StyleManager styleManager)
     : base(styleManager)
 {
     // TODO: Move to resources
     DisplayName = "Build error message";
 }