object IAction.ControlAction(ICore sender, AtomusPageArgs e) { try { this.beforeActionEventHandler?.Invoke(this, e); //switch (e.Action) //{ // case "Back": // Navigation.PopModalAsync(); // break; // case "Barcode.Detected": // this.afterActionEventHandler?.Invoke(this, e); // break; //} return(true); } finally { Device.BeginInvokeOnMainThread(() => { this.afterActionEventHandler?.Invoke(this, e); }); //if (e.Action != "Barcode.Detected") } }
object IAction.ControlAction(ICore sender, AtomusPageArgs e) { try { this.beforeActionEventHandler?.Invoke(this, e); switch (e.Action) { case "Menu.AddHome": //((DefaultBrowserStandardMasterViewModel)this.BindingContext).MenuItems.Insert(0, new MenuItem() { Id = 0, Title = "Home", Page = (Xamarin.Forms.Page)e.Value }); return(true); case "Menu.LoadInfo": (this.BindingContext as DefaultMenuViewModel).GetPoint(); return(true); default: throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action)); } } finally { this.afterActionEventHandler?.Invoke(this, e); } }
object IAction.ControlAction(ICore sender, AtomusPageArgs e) { string tmp; string[] tmps; decimal assemblyID; decimal menuID; try { this.beforeActionEventHandler?.Invoke(this, e); switch (e.Action) { case "Menu.AddHome": //((DefaultBrowserStandardMasterViewModel)this.BindingContext).MenuItems.Insert(0, new MenuItem() { Id = 0, Title = "Home", Page = (Xamarin.Forms.Page)e.Value }); return(true); case "Menu.LoadInfo": (this.BindingContext as ModernMenuViewModel).GetPoint(); return(true); case "UserControl.OpenControl": tmp = (e.Value as string); if (!tmp.IsNullOrEmpty()) { tmps = tmp.Split(','); menuID = tmps[0].ToDecimal(); assemblyID = tmps[1].ToDecimal(); var a = from sel in (this.BindingContext as ModernMenuViewModel).MenuItems where sel.AssemblyID == assemblyID && sel.MenuID == menuID select sel; if (a != null && a.Count() > 0) { this.ListView_ItemSelected(null, new SelectedItemChangedEventArgs(a.First())); } } return(true); default: throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action)); } } finally { this.afterActionEventHandler?.Invoke(this, e); } }
object IAction.ControlAction(ICore sender, AtomusPageArgs e) { object[] objects; try { this.beforeActionEventHandler?.Invoke(this, e); switch (e.Action) { case "UserControl.OpenControl": (Master as IAction).ControlAction(this, e); //objects = (object[])e.Value;//_MENU_ID, _ASSEMBLY_ID, sender, AtomusControlArgs //e.Value = this.OpenControl((decimal)objects[0], (decimal)objects[1], sender,(objects[2] as AtomusPageEventArgs), true); //if (e.Value != null) // ((NavigationPage)Detail).PushAsync((Xamarin.Forms.Page)e.Value, false); break; //case "New": // return this.InitControl(); //case "Search": // if (e.Value != null && e.Value is DataTable && (e.Value as DataTable).Rows.Count > 0) // return this.Search(e.Value as DataTable); // else // return this.Search(); //case "Button1": // return this.SearchBest(); //case "Button2": // return this.ShowAdd(); //case "Button3": // return this.ShowTrend(); default: throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action)); } return(true); } finally { this.afterActionEventHandler?.Invoke(this, e); } }
object IAction.ControlAction(ICore sender, AtomusPageArgs e) { try { this.beforeActionEventHandler?.Invoke(this, e); switch (e.Action) { case "CreateStyle": return(this.CreateStyle()); } return(true); } finally { this.afterActionEventHandler?.Invoke(this, e); } }
object IAction.ControlAction(ICore sender, AtomusPageArgs e) { try { this.beforeActionEventHandler?.Invoke(this, e); switch (e.Action) { case "WebVIew.Home": if (((StackLayout)this.Content).Children.Count > 0 && ((StackLayout)this.Content).Children[0] is WebView) { ((WebView)((StackLayout)this.Content).Children[0]).Source = this.GetAttribute("WebView.Source"); } return(true); case "WebVIew.Back": if (((StackLayout)this.Content).Children.Count > 0 && ((StackLayout)this.Content).Children[0] is WebView && ((WebView)((StackLayout)this.Content).Children[0]).CanGoBack) { ((WebView)((StackLayout)this.Content).Children[0]).GoBack(); } return(true); case "WebVIew.Forward": if (((StackLayout)this.Content).Children.Count > 0 && ((StackLayout)this.Content).Children[0] is WebView && ((WebView)((StackLayout)this.Content).Children[0]).CanGoForward) { ((WebView)((StackLayout)this.Content).Children[0]).GoForward(); } return(true); default: throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action)); } //return true; } finally { this.afterActionEventHandler?.Invoke(this, e); } }
object IAction.ControlAction(ICore sender, AtomusPageArgs e) { try { this.beforeActionEventHandler?.Invoke(this, e); //switch (e.Action) //{ // case "New": // return this.InitControl(); // case "Search": // if (e.Value != null && e.Value is DataTable && (e.Value as DataTable).Rows.Count > 0) // return this.Search(e.Value as DataTable); // else // return this.Search(); // case "Button1": // return this.SearchBest(); // case "Button2": // return this.ShowAdd(); // case "Button3": // return this.ShowTrend(); // default: // throw new AtomusException("'{0}'은 처리할 수 없는 Action 입니다.".Translate(e.Action)); //} return(true); } finally { this.afterActionEventHandler?.Invoke(this, e); } }