Exemple #1
0
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            AtomusControlEventArgs atomusControlEventArgs;

            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                case "Email.Focus":
                    this.Email.Focus();
                    return(true);

                case "AccessNumber.Focus":
                    this.AccessNumber.Focus();
                    return(true);

                case "Form.Size":
                    if (this.Background == null)    //이미지를 늦게 불러오는 경우에 다시 반영
                    {
                        this.Background = (this.DataContext as ViewModel.DefaultLoginViewModel).BackgroundImage;
                    }
                    return(true);

                case "Login.Cancel":
                    return(true);

                case "Opacity.Set":
                    return(true);

                case "Opacity.Get":
                    atomusControlEventArgs = new AtomusControlEventArgs("Opacity.Get", null);
                    this.afterActionEventHandler?.Invoke(this, atomusControlEventArgs);

                    return(atomusControlEventArgs.Value);

                case "Login.Ok":
                    return(true);

                case "Login.JoinOrAccessNumberChange":
                    return(true);

                case "Login.LanguageSelected":
                    this.Translator().Restoration(this);
                    this.Translator().Translate(this);
                    return(true);

                default:
                    throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                if (!new string[] { "Email.Focus", "AccessNumber.Focus", "Opacity.Get", "Login.LanguageSelected" }.Contains(e.Action))
                {
                    this.afterActionEventHandler?.Invoke(this, e);
                }
            }
        }
Exemple #2
0
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                default:
                    userControl.ControlAction(sender, e);
                    //throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));

                    break;
                }

                return(null);
            }
            finally
            {
                if (!new string[] { "Join.ClearPassword" }.Contains(e.Action))
                {
                    this.afterActionEventHandler?.Invoke(this, e);
                }
            }
        }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            string skin;

            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                case "CreateStyle":
                    this.ResourceDictionaryRoot = (ResourceDictionary)e.Value;

                    skin = Config.Client.GetAttribute("SkinName").ToString();

                    this.CreateStyle(skin);

                    this.SetStyle(skin);
                    //new Task(() => { this.SetStyle(skin); }).RunSynchronously();

                    return(null);
                }

                return(true);
            }
            finally
            {
                this.afterActionEventHandler?.Invoke(this, e);
            }
        }
Exemple #4
0
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                //switch (e.Action)
                //{
                //    case "Join.Cancel":
                //        return true;

                //    case "Form.Size":
                //        if (this.Background == null)//이미지를 늦게 불러오는 경우에 다시 반영
                //            this.Background = (this.DataContext as ViewModel.DefaultJoinViewModel).BackgroundImage;

                //        //this.afterActionEventHandler?.Invoke(this, e);
                //        return true;

                //    case "Join.ClearPassword":
                //        this.AccessNumberOld.Password = "";
                //        this.AccessNumber.Password = "";
                //        this.AccessNumberRetry.Password = "";
                //        return true;

                //    default:
                //        throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                //}

                return(null);
            }
            finally
            {
                this.afterActionEventHandler?.Invoke(this, e);
            }
        }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            try
            {
                if (e.Action != "AddUserControl" && e.Action != "Login")
                {
                    this.beforeActionEventHandler?.Invoke(this, e);
                }

                switch (e.Action)
                {
                case "Login":
                    if (!this.IsLoginExcute)
                    {
                        this.IsLoginExcute = true;
                        beforeActionEventHandler.Invoke(this, new AtomusControlEventArgs()
                        {
                            Action = "Login"
                        });
                    }
                    else
                    {
                        (this.MainWindow as IAction).ControlAction(sender, "Login", e.Value);
                    }


                    return(true);

                case "AddUserControl":
                    if (!this.IsAddUserControlExcute)
                    {
                        this.IsAddUserControlExcute = true;
                        beforeActionEventHandler.Invoke(this, new AtomusControlEventArgs()
                        {
                            Action = "AddUserControl"
                        });
                    }
                    else
                    {
                        (this.MainWindow as IAction).ControlAction(sender, "AddUserControl", e.Value);
                    }

                    return(true);

                default:
                    throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                if (e.Action != "AddUserControl" && e.Action != "Login")
                {
                    this.afterActionEventHandler?.Invoke(this, e);
                }
            }

            return(true);
        }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            IAction userControl;

            object[] objects;
            IAction  core;

            try
            {
                if (e.Action != "AddUserControl" && e.Action != "Login")
                {
                    this.beforeActionEventHandler?.Invoke(this, e);
                }

                switch (e.Action)
                {
                case "Login":
                    objects = (object[])e.Value;

                    (this.DataContext as ViewModel.ModernBrowserDebugViewModel).Login((string)objects[0], (string)objects[1], (string)objects[2], (string)objects[3]);
                    return(true);

                case "AddUserControl":
                    objects = (object[])e.Value;

                    this.menuDatabaseName = (string)objects[4];
                    this.menuProcedureID  = (string)objects[5];

                    userControl = (IAction)objects[9];

                    core = (this.DataContext as ViewModel.ModernBrowserDebugViewModel).OpenControlProcess(this.menuDatabaseName, this.menuProcedureID, (decimal)objects[7], (decimal)objects[8], userControl);

                    e.Value = core;

                    core.BeforeActionEventHandler += UserControl_BeforeActionEventHandler;
                    core.AfterActionEventHandler  += UserControl_AfterActionEventHandler;

                    this.AddTabItem(core.GetAttribute("NAME"), core.GetAttribute("DESCRIPTION"), core);

                    return(true);

                default:
                    throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                if (e.Action != "AddUserControl" && e.Action != "Login")
                {
                    this.afterActionEventHandler?.Invoke(this, e);
                }
            }
        }
Exemple #7
0
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                case "Selected":
                    this.DictionaryWindow_Deactivated(this, null);
                    return(true);

                case "ADD_COMBO_ITEM":
                    if (e.Value == null)
                    {
                        (this.DataContext as ViewModel.DictionaryWindowViewModel).SearchSyncCommand.Execute(null);
                        if ((this as IDictionary).AfterAction != null)
                        {
                            (this as IDictionary).DataRow = (this as IDictionary).DataTable.Rows[0];
                            (this as IDictionary).AfterAction.Invoke(null, (this as IDictionary));
                        }
                    }
                    else if (e.Value is List <object> )
                    {
                        // [0]: Code                (string)
                        // [1]: SearchIndex         (int)
                        // [2]: SearchText          (string)
                        // [3]: Target              (ComboBox)
                        // [4]: DisplayMemberPath   (string)
                        // [5]: SelectedValuePath   (string)

                        List <object> data = e.Value as List <object>;
                        (this as IDictionary).Code        = data[0].ToString();
                        (this as IDictionary).SearchIndex = data[1].ToString().ToInt();
                        (this as IDictionary).SearchText  = data[2].ToString();
                        ComboBox combo = data[3] as ComboBox;
                        combo.DisplayMemberPath = data[4].ToString();
                        combo.SelectedValuePath = data[5].ToString();

                        (this.DataContext as ViewModel.DictionaryWindowViewModel).SearchSyncCommand.Execute(null);
                        combo.ItemsSource = (this as IDictionary).DataTable.DefaultView;
                    }
                    return(true);

                default:
                    throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                this.afterActionEventHandler?.Invoke(this, e);
            }
        }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                //case "ExpandAllNodes":
                //    this.treeView.Items.OfType<System.Windows.Controls.TreeViewItem>().ToList().ForEach(x => this.ExpandAllNodes(x, (bool)e.Value));
                //    return true;

                //case "CollapseAllNodes":
                //    this.treeView.Items.OfType<System.Windows.Controls.TreeViewItem>().ToList().ForEach(x => this.ExpandAllNodes(x, (bool)e.Value));
                //    return true;

                case "Menu.MenuFolding":
                    return(true);

                case "Menu.OpenControl":
                    return(true);

                case "Menu.TopMenu":
                    return((this.DataContext as ViewModel.ModernMenuViewModel).GetSearchTopMenu());

                case "Menu.TopMenuSelected":
                    if (e.Value != null && e.Value is object[] && (e.Value as object[]).Length == 2)
                    {
                        (this.DataContext as ViewModel.ModernMenuViewModel).MenuID       = (decimal)(e.Value as object[])[0];
                        (this.DataContext as ViewModel.ModernMenuViewModel).ParentMenuID = (decimal)(e.Value as object[])[1];

                        (this.DataContext as ViewModel.ModernMenuViewModel).SearchCommand.Execute(null);
                    }
                    return(true);

                default:
                    throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                if (!new string[] { "ExpandAllNodes", "CollapseAllNodes", "Menu.TopMenu", "Menu.TopMenuSelected" }.Contains(e.Action))
                {
                    this.afterActionEventHandler?.Invoke(this, e);
                }
            }
        }
Exemple #9
0
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                default:
                    throw new AtomusException((this).GetMessage("Common", "00047", "'{0}'은(는) 처리할 수 없는 {1} 입니다.").Message.Translate(e.Action, "Action"));
                    //throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                this.afterActionEventHandler?.Invoke(this, e);
            }
        }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            Dictionary <string, object> pairs;
            QueueData queueDatas;

            try
            {
                if (e.Value is Dictionary <string, object> )
                {
                    pairs = e.Value as Dictionary <string, object>;

                    if (pairs.Count == 7)
                    {
                        queueDatas                = new QueueData();
                        queueDatas.IP_ADDRESS     = (string)pairs["IP_ADDRESS"];
                        queueDatas.USER_ID        = (string)pairs["USER_ID"];
                        queueDatas.REQUESTER      = (string)pairs["REQUESTER"];
                        queueDatas.REQUEST_BODY   = (string)pairs["REQUEST_BODY"];
                        queueDatas.REQUEST_RESULT = (string)pairs["REQUEST_RESULT"];
                        queueDatas.START_DATETIME = (DateTime)pairs["START_DATETIME"];
                        queueDatas.END_DATETIME   = (DateTime)pairs["END_DATETIME"];

                        this.Queue.Enqueue(queueDatas);
                    }
                }
                else
                {
                    if (e.Action == "Stop")
                    {
                        this.isStop = true;
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            int[] colRow;

            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                case "SetControl":
                    this.browser = (IAction)sender;

                    return(true);

                case "SetBackGroundColor":
                    if (e.Value is Color)
                    {
                        this.backGroundColor = (Color)e.Value;
                        return(true);
                    }

                    return(false);

                case "bool":
                    if (e.Value is Color)
                    {
                        this.isCaptureCursor = (bool)e.Value;
                        return(true);
                    }

                    return(false);

                case "GetScreenImage":
                    if (e.Value != null)
                    {
                        if (e.Value is Rectangle)
                        {
                            return(this.GetScreenImage((Rectangle)e.Value));
                        }

                        return(false);
                    }
                    else
                    {
                        return(this.GetScreenImage(this.ScreenRectangle, Color.Empty));
                    }

                case "GetScreenImages":

                    if (e.Value != null)
                    {
                        if (e.Value is int[])
                        {
                            colRow = (int[])e.Value;
                            return(this.GetScreenImages(colRow[0], colRow[1]));
                        }
                        return(this.GetScreenImages(1, 1));;
                    }
                    else
                    {
                        return(this.GetScreenImages(1, 1));
                    };


                case "GetScreenRectangle":
                    return(this.ScreenRectangle);

                default:
                    throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action));
                }
            }
            finally
            {
                this.afterActionEventHandler?.Invoke(this, e);
            }
        }
Exemple #12
0
 object IAction.ControlAction(ICore sender, AtomusControlArgs e)
 {
     //this.InitializeComponent();
     return(true);
 }
        object IAction.ControlAction(ICore sender, AtomusControlArgs e)
        {
            //AtomusControlEventArgs atomusControlEventArgs;

            try
            {
                this.beforeActionEventHandler?.Invoke(this, e);

                switch (e.Action)
                {
                case "UserToolbarButton.Remove":
                    this.ToolbarButtonsRemove(sender);
                    return(true);

                case "UserToolbarButton.Add":
                    this.ToolbarButtonsAdd(sender);
                    return(true);

                case "Menu.TopMenu":
                    if (e.Value != null && e.Value is DataTable)
                    {
                        (this.DataContext as ViewModel.ModernToolbarViewModel).SetTopMenu(e.Value as DataTable);
                    }

                    return(true);

                case "Menu.TopMenuSelected":
                    return(true);

                //case "Toolbar.Background":
                //    return this.ribbon.Background;

                //case "Toolbar.BorderBrush":
                //    return this.ribbon.BorderBrush;

                //case "Toolbar.BorderThickness":
                //    return this.ribbon.BorderThickness;


                default:
                    if (e.Action.StartsWith("Action."))
                    {
                        foreach (RibbonButton ribbonButton in this.FindVisualChildren <RibbonButton>())
                        {
                            if (ribbonButton.Name.Equals(e.Action.Split('.')[1]))
                            {
                                ribbonButton.IsEnabled = e.Value.Equals("Y");
                                return(true);
                            }
                        }
                    }

                    if (e.Action.StartsWith("Action."))
                    {
                        (this.DataContext as ViewModel.ModernToolbarViewModel).SetActionButton(e.Action.Split('.')[1], e.Value.Equals("Y"));
                    }

                    return(false);
                }
            }
            finally
            {
                if (!new string[] { "UserToolbarButton.Remove", "UserToolbarButton.Add", "Menu.TopMenu" }.Contains(e.Action))
                {
                    this.afterActionEventHandler?.Invoke(this, e);
                }
            }
        }