Пример #1
0
        void RemovePanel(string mt)
        {
            MimeTypePanelData data = typeSections [mt];

            typeSections.Remove(mt);
            ParentDialog.RemoveSection(data.Section);
        }
        MimeTypePanelData AddPanel(string mt)
        {
            var chain = new List <string> (DesktopService.GetMimeTypeInheritanceChain(mt).Where(x => mimeTypesWithPolicies.Contains(x)));

            if (chain.Count == 0)
            {
                return(null);
            }
            MimeTypePanelData    data = new MimeTypePanelData();
            OptionsDialogSection sec  = new OptionsDialogSection(typeof(MimeTypePolicyOptionsSection));

            sec.Fill = true;
            Gdk.Pixbuf icon = DesktopService.GetPixbufForType(mt, Gtk.IconSize.Menu);
            sec.Icon             = ImageService.GetStockId(icon, Gtk.IconSize.Menu);
            data.Section         = sec;
            data.MimeType        = mt;
            data.TypeDescription = DesktopService.GetMimeTypeDescription(mt);
            if (string.IsNullOrEmpty(data.TypeDescription))
            {
                data.TypeDescription = mt;
            }
            data.DataObject      = DataObject;
            data.PolicyContainer = policyContainer;
            sec.Label            = data.TypeDescription;
            LoadPolicyTypeData(data, mt, chain);
            typeSections [mt] = data;
            ParentDialog.AddChildSection(this, sec, data);
            return(data);
        }
Пример #3
0
        void RemovePanel(RunConfigInfo rc)
        {
            var section = sections [rc];

            sections.Remove(rc);
            ParentDialog.RemoveSection(section);
        }
Пример #4
0
 protected void StartNextAction()
 {
     if (SubDialogs.Any() && _currentSubDialogIndex < SubDialogs.Count())
     {
         _currentSubDialogIndex++;
         SubDialogs.ElementAt(_currentSubDialogIndex - 1).LoadDialog();
     }
     else if (!DialogCompletionCommit)
     {
         DialogCompletionCommit = true;
         CompleteDialog();
     }
     else
     {
         if (ParentDialog != null)
         {
             ParentDialog.StartNextAction();
         }
         else
         {
             ApplicationController.LogEvent(DialogEventName + " Completed", GetPropertiesForCompletedLog());
             if (OverideCompletionScreenMethod != null)
             {
                 OverideCompletionScreenMethod();
             }
             else
             {
                 Controller.ShowCompletionScreen(this);
             }
         }
     }
 }
Пример #5
0
        internal void ShowConfiguration(ProjectRunConfiguration editedConfig)
        {
            var rc      = configs.First(ci => ci.EditedConfig == editedConfig);
            var section = sections [rc];

            ParentDialog.ShowPage(section);
        }
Пример #6
0
        void Editor_Changed(object sender, EventArgs e)
        {
            editor.Save();
            var panel = ParentDialog.GetPanel <RunConfigurationsPanel> ("General");

            panel.RefreshList();
        }
        internal void ShowConfiguration(MultiItemSolutionRunConfiguration editedConfig)
        {
            var rc      = configs.First(ci => ci.EditedConfig.Name == editedConfig.Name);
            var section = sections [rc];

            ParentDialog.ShowPage(section);
        }
 private void Visualization_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (ParentDialog != null)
     {
         ParentDialog.VisualizationClosed();
     }
 }
Пример #9
0
        MimeTypePanelData AddPanel(string mt)
        {
            var chain = new List <string> (DesktopService.GetMimeTypeInheritanceChain(mt).Where(mimeTypesWithPolicies.Contains));

            if (chain.Count == 0)
            {
                return(null);
            }
            MimeTypePanelData    data = new MimeTypePanelData();
            OptionsDialogSection sec  = new MimetypeOptionsDialogSection(mt);

            sec.Fill             = true;
            data.Section         = sec;
            data.MimeType        = mt;
            data.TypeDescription = DesktopService.GetMimeTypeDescription(mt);
            if (string.IsNullOrEmpty(data.TypeDescription))
            {
                data.TypeDescription = mt;
            }
            data.DataObject      = DataObject;
            data.PolicyContainer = policyContainer;
            sec.Label            = data.TypeDescription;
            LoadPolicyTypeData(data, mt, chain);
            typeSections [mt] = data;
            ParentDialog.AddChildSection(this, sec, data);
            return(data);
        }
 private void PlanetNStarDetails_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (ParentDialog != null)
     {
         ParentDialog.ExoplanetDetailsClosed();
     }
 }
 void SelectionChanged(object sender, WidgetEventArgs e)
 {
     Xwt.Application.Invoke(delegate {
         SaveChanges();
         var panel = ParentDialog.GetPanel <SolutionRunConfigurationsPanel> ("General");
         panel.RefreshList();
     });
 }
Пример #12
0
        void AddPanel(RunConfigInfo configInfo)
        {
            configInfo.Project = Project;
            var sec = new RunConfigurationOptionsDialogSection(configInfo);

            sec.Fill = true;
            sections [configInfo] = sec;
            ParentDialog.AddChildSection(this, sec, configInfo);
        }
        void AddPanel(SolutionRunConfigInfo configInfo)
        {
            configInfo.Solution = Solution;
            var sec = new SolutionRunConfigurationOptionsDialogSection(configInfo);

            sec.Fill = true;
            sections [configInfo] = sec;
            ParentDialog.AddChildSection(this, sec, configInfo);
        }
Пример #14
0
 protected void ProcessError(Exception ex)
 {
     //note also used in CompleteDialog determining not to continue to next action
     FatalException = ex;
     if (ParentDialog != null)
     {
         ParentDialog.ProcessError(ex);
     }
     else
     {
         CompletionMessage = string.Format("Fatal error:\n{0}", ex.DisplayString());
         Controller.ShowCompletionScreen(this);
     }
 }
Пример #15
0
 void KeyBoardPad_KeyReleaseEvent(object o, KeyReleaseEventArgs args)
 {
     if (args.Event.Key.ToString().Equals("Return"))
     {
         //KeyboardKey vKey = (KeyboardKey)args.Event.Key;
         if (_textEntry.Validated)
         {
             ParentDialog.Respond(ResponseType.Ok);
         }
         else
         {
             Utils.ShowMessageTouch(ParentDialog, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, Resx.global_error, Resx.dialog_message_field_validation_error_keyboardpad);
         }
     }
 }
Пример #16
0
 void KeyBoardPad_KeyReleaseEvent(object o, KeyReleaseEventArgs args)
 {
     if (args.Event.Key.ToString().Equals("Return"))
     {
         //KeyboardKey vKey = (KeyboardKey)args.Event.Key;
         if (_textEntry.Validated)
         {
             ParentDialog.Respond(ResponseType.Ok);
         }
         else
         {
             Utils.ShowMessageTouch(ParentDialog, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "global_error"), resources.CustomResources.GetCustomResources(GlobalFramework.Settings["customCultureResourceDefinition"], "dialog_message_field_validation_error_keyboardpad"));
         }
     }
 }
        public override void Initialize(OptionsDialog dialog, object dataObject)
        {
            base.Initialize(dialog, dataObject);

            Solution = (Solution)dataObject;

            foreach (var rc in Solution.MultiStartupRunConfigurations)
            {
                var c = new SolutionRunConfigInfo {
                    ProjectConfig = rc, EditedConfig = new MultiItemSolutionRunConfiguration(rc)
                };
                configs.Add(c);
                AddPanel(c);
            }
            ParentDialog.ExpandChildren(this);
        }
Пример #18
0
        protected void MoveBackToPrevious()
        {
            if (ParentDialog == null)
            {
                throw new Exception("Cannot Move Back. Parent Dialog Is Null");
            }
            if (ParentDialog._currentSubDialogIndex < 2)
            {
                throw new NotImplementedException("Cannot Move Back. Not Implemented For The First Child Dialog Of The Parent");
            }
            var previousDialog = ParentDialog.SubDialogs.ElementAt(ParentDialog._currentSubDialogIndex - 2);

            previousDialog.DialogCompletionCommit = false;
            ParentDialog._currentSubDialogIndex   = ParentDialog._currentSubDialogIndex - 2;
            ParentDialog.StartNextAction();
        }
Пример #19
0
 protected void ProcessError(Exception ex)
 {
     //note also used in CompleteDialog determining not to continue to next action
     FatalException = ex;
     if (ParentDialog != null)
     {
         ParentDialog.ProcessError(ex);
     }
     else
     {
         ApplicationController.LogEvent(DialogEventName + " Fatal Error", new Dictionary <string, string> {
             { "Is Error", true.ToString() }, { "Error", ex.Message }, { "Error Trace", ex.DisplayString() }
         });
         Controller.ShowCompletionScreen(this);
     }
 }
Пример #20
0
        public override void Initialize(OptionsDialog dialog, object dataObject)
        {
            base.Initialize(dialog, dataObject);

            Project = (Project)dataObject;

            if (!Project.SupportsRunConfigurations())
            {
                return;
            }

            foreach (var rc in Project.RunConfigurations)
            {
                configs.Add(new RunConfigInfo {
                    ProjectConfig = rc, EditedConfig = Project.CloneRunConfiguration(rc, rc.Name)
                });
            }

            foreach (var c in configs)
            {
                AddPanel(c);
            }
            ParentDialog.ExpandChildren(this);
        }
Пример #21
0
        //Process Keyboard Inputs
        private void keyboardPadKey_Clicked(object sender, EventArgs e)
        {
            KeyboardPadKey       vKey           = (KeyboardPadKey)sender;
            VirtualKeyProperties vKeyProperties = null;
            Char   _unicodeChar;
            bool   _requireUpdate = false;
            bool   _skipInsert    = false;
            int    _tempCursorPosition;
            String _stringChar;

            int selectionStart, selectionEnd;

            _textEntry.GetSelectionBounds(out selectionStart, out selectionEnd);
            if (selectionStart > 0 || selectionEnd > 0)
            {
                _textEntry.DeleteSelection();
            }

            //Get Level and Assign Level Properties to current vKeyProperties
            switch (_activeModifierKey)
            {
            case ModifierKeys.Shift:
                vKeyProperties = vKey.Properties.L2;
                break;

            case ModifierKeys.Alt:
                vKeyProperties = vKey.Properties.L3;
                break;

            default:
                vKeyProperties = vKey.Properties.L1;
                break;
            }

            //DeadKey
            if (vKeyProperties != null && vKeyProperties.IsDeadKey)
            {
                _requireUpdate     = true;
                _skipInsert        = true;
                _activeDiacritical = vKeyProperties.Diacritical;
            }
            ;

            //Process Keys, Modifiers
            switch (vKey.Properties.Type)
            {
            //Sticky Caps Lock
            case "caps":
                _requireUpdate = true;
                if (_isCapsEnabled == false)
                {
                    _isCapsEnabled = true;
                }
                else
                {
                    _isCapsEnabled = false;
                }
                break;

            //Modifier Shift
            case "shift":
                _requireUpdate = true;
                if (_activeModifierKey == ModifierKeys.Shift)
                {
                    _activeModifierKey = ModifierKeys.None;
                }
                else
                {
                    _activeModifierKey = ModifierKeys.Shift;
                };
                break;

            //Modifier Alt
            case "alt":
                _requireUpdate = true;
                if (_activeModifierKey == ModifierKeys.Alt)
                {
                    _activeModifierKey = ModifierKeys.None;
                }
                else
                {
                    _activeModifierKey = ModifierKeys.Alt;
                };
                break;

            //Modifier Shift
            case "ctrl":
                _requireUpdate = true;
                if (_activeModifierKey == ModifierKeys.Ctrl)
                {
                    _activeModifierKey = ModifierKeys.None;
                }
                else
                {
                    _activeModifierKey = ModifierKeys.Ctrl;
                };
                break;

            //Modal Cancel
            case "esc":
                ParentDialog.Respond(ResponseType.Cancel);
                break;

            //Modal Confirm
            case "enter":
                if (_textEntry.Validated)
                {
                    // This Will Crash only in Debug, if Run Outside it Wont Crash (Simply disappear without log error)
                    try
                    {
                        ParentDialog.Respond(ResponseType.Ok);
                    }
                    catch (Exception ex)
                    {
                        _log.Error(ex.Message, ex);
                    }
                }
                else
                {
                    Utils.ShowMessageTouch(ParentDialog, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, Resx.global_error, Resx.dialog_message_field_validation_error_keyboardpad);
                };
                break;

            //Show/Hide Number Lock
            case "tab":
                if (_activeKeyboardMode == KeyboardMode.AlfaNumeric)
                {
                    if (_vboxNumPadRows.Visible)
                    {
                        ParentDialog.WidthRequest -= _vboxNumPadRows.Allocation.Width + _spacing;
                        _vboxNumPadRows.HideAll();
                    }
                    else
                    {
                        ParentDialog.WidthRequest += _vboxNumPadRows.Allocation.Width + _spacing;
                        _vboxNumPadRows.ShowAll();
                    };
                }
                break;

            //Enable/Disable Internal Keyboard
            case "ekey":
                break;

            //Delete
            case "back":
                _textEntry.DeleteText(_textEntry.Position - 1, _textEntry.Position);
                break;

            //Cursor Move to Start
            case "home":
                _textEntry.Position = 0;
                break;

            //Cursor Move to End
            case "end":
                _textEntry.Position = _textEntry.Text.Length;
                break;

            //Does Nothing
            case "up":
                break;

            //Does Nothing
            case "down":
                break;

            //Move Cursor to Left
            case "left":
                if (_textEntry.Position > 0)
                {
                    _textEntry.Position -= 1;
                }
                break;

            //Move Cursor to Right
            case "right":
                if (_textEntry.Position < _textEntry.Text.Length)
                {
                    _textEntry.Position += 1;
                }
                break;

            //All Other Keys
            default:
                //NumberPad always work only with L1
                if (vKey.Properties.L1.IsNumPad == true || vKey.Properties.Type == "space")
                {
                    vKeyProperties = vKey.Properties.L1;
                }
                //If Caps enabled and is Letter, change to Level 2 (Uppercase)
                else if (_isCapsEnabled && Utils.IsLetter(Utils.UnicodeHexadecimalStringToChar(vKeyProperties.UnicodeId)))
                {
                    vKeyProperties = vKey.Properties.L2;
                }
                ;
                //Get unicodeChar from UnicodeId after Caps
                _unicodeChar = Utils.UnicodeHexadecimalStringToChar(vKeyProperties.UnicodeId);
                //Modifie _unicodeChar Keys ex Culture Decimal Separator . with , [3,15 = Key NumberPad .]
                //if (vKey.Properties.RowIndex == 3 && vKey.Properties.ColIndex == 15) _unicodeChar = (char) GlobalFramework.CurrentCulture.NumberFormat.NumberDecimalSeparator[0];
                //Always Disable Modifiers Keys After Use
                if (_activeModifierKey != ModifierKeys.None)
                {
                    _requireUpdate = true;
                    //Process Modifiers aBefore Disable Modifier
                    switch (_activeModifierKey)
                    {
                    case ModifierKeys.Ctrl:
                        switch (Convert.ToString(_unicodeChar).ToUpper())
                        {
                        case "X":
                            _textEntry.CutClipboard();
                            _skipInsert = true;
                            break;

                        case "C":
                            _textEntry.CopyClipboard();
                            _skipInsert = true;
                            break;

                        case "V":
                            _textEntry.PasteClipboard();
                            _skipInsert = true;
                            break;
                        }
                        break;

                    default:
                        break;
                    }
                    //After Process Modifiers, restore default Non Modifiers State
                    _activeModifierKey = ModifierKeys.None;
                }
                ;

                //Debug
                //_log.Debug(string.Format("keyboardKey_Clicked(): L1.Glyph:[{1}] L1.UnicodeId:[{2}] L1.CharacterName:[{3}] unicodeChar[{4}]", vKey.Properties.Type, vKeyProperties.Glyph, vKeyProperties.UnicodeId, vKeyProperties.CharacterName, _unicodeChar));

                //Add to TextEntry
                _tempCursorPosition = _textEntry.Position;

                if (!_skipInsert)
                {
                    _stringChar = Convert.ToString(_unicodeChar);
                    //Diacritical
                    if (_activeDiacritical != null)
                    {
                        _stringChar += Convert.ToString(Utils.UnicodeHexadecimalStringToChar(_activeDiacritical));
                        //Convert Diacritial chars to ISO chars to work with Validations and Peristence Database
                        _stringChar = ReplaceDiacritial(_stringChar);
                        //Reset activeDiacritical
                        _activeDiacritical = null;
                    }
                    _textEntry.InsertText(_stringChar, ref _tempCursorPosition);
                    _textEntry.Text.Normalize();
                }
                ;
                _textEntry.Position = _tempCursorPosition;
                break;
            }

            //HACK: to Activate TextEntry and place Cursor
            _tempCursorPosition = _textEntry.Position;
            _textEntry.GrabFocus();
            _textEntry.Position = _tempCursorPosition;

            //Update Keyboard if ModifierKey has Changed
            if (_requireUpdate)
            {
                UpdateKeyboard();
            }
        }
Пример #22
0
 /// <summary>
 /// Remove this variable.
 /// </summary>
 public void RemoveBtn_Clicked(object sender, EventArgs e)
 {
     ParentDialog.RemoveVariable(this);
 }