protected override void initAfterSettings() { base.initAfterSettings(); ImplDataReference ref_ = ToolMobile.getEnvironment().getReference(this.Intent.GetStringExtra(ConstCmdLine.cmd)) as ImplDataReference; if (ref_ != null) { reference = ref_; } getBtnCancel().Click += BtnCancel_Click; getBtnOk().Click += BtnOk_Click; getBtnOk().Visibility = showMode ? ViewStates.Invisible : ViewStates.Visible; string col_ = Intent.GetStringExtra(TableDUMMY.COLUMN); string val_ = Intent.GetStringExtra(TableDUMMY.VALUE); if (col_ != null && !string.IsNullOrEmpty(val_)) { setValue(val_); } }
void share() { string text_ = renderingData; text_ = openSpeChar(text_); text_ = hideEscPosParts(text_); var cntxt = ToolMobile.getContextLast(); if (cntxt == null) { return; } var langRep = ToolMobile.getEnvironment().translate("T_REPORT"); var langSend = ToolMobile.getEnvironment().translate("T_SEND"); Intent sharingIntent = new Intent(Intent.ActionSend); // sharingIntent.SetType("text/html"); if (isHtml(text_)) { var desc = ToolMobile.getEnvironment().translate("T_REPORT") + " " + XmlFormating.helper.format(DateTime.Now); desc = desc.Replace(' ', '_'); var name = desc + ".html"; var path = ToolMobile.getTmpFile(name); ToolMobile.writeFileText(path, text_); var uri = Android.Net.Uri.FromFile(new Java.IO.File(path)); sharingIntent.PutExtra(Intent.ExtraSubject, desc); sharingIntent.PutExtra(Intent.ExtraStream, uri); sharingIntent.SetType("text/html"); } else { sharingIntent.SetType("text/plain"); sharingIntent.PutExtra(Intent.ExtraText, text_); } // sharingIntent.setType("application/*|text/*"); var data = text_; // cData.Text); // cntxt.StartActivity(Intent.CreateChooser(sharingIntent, langSend)); }
void DefaultView_ListChanged(object sender, ListChangedEventArgs e) { if (e.ListChangedType == ListChangedType.Reset) { grid.refreshBind(); ToolMobile.getEnvironment().setStateRuntime(stateNameSort, grid.DataSourceDataView.Sort); } }
void initTable(DataTable pTable) { ToolTable.fillNull(pTable); string sort_ = ToolMobile.getEnvironment().getStateRuntime(stateNameSort) as string; if (sort_ != null && pTable.DefaultView.Sort != sort_) { pTable.DefaultView.Sort = sort_; } }
public void recordIdSave(DataRow pRow) { object val = null; if (pRow != null && pRow.RowState != DataRowState.Deleted && pRow.Table.Columns[TableDUMMY.LOGICALREF] != null) { val = pRow[TableDUMMY.LOGICALREF]; } ToolMobile.getEnvironment().setStateRuntime(stateRecordId, val); }
protected override MobDataReferenceGridFormBase.CmdMenuItem[] createMenuItems() { List <CmdMenuItem> list = new List <CmdMenuItem>(); list.AddRange(base.createMenuItems()); list.Add(new CmdMenuItem() { CmdType = CmdType.doc1, Text = ToolMobile.getEnvironment().translate(WordCollection.T_CASH) }); return(list.ToArray()); }
static string translate(string msg) { try { if (ToolMobile.isEnvInited()) { return(ToolMobile.getEnvironment().translate(msg)); } } catch { } return(msg); }
public object[] filterLoad(string[] pCols) { string[] cols_ = ToolMobile.getEnvironment().getStateRuntime(stateFilterCols) as string[]; object[] vals_ = ToolMobile.getEnvironment().getStateRuntime(stateFilterVal) as object[]; if (cols_ != null && pCols != null && ToolArray.compare(cols_, pCols) == 0) { return(vals_); } return(null); }
public object done() { if (activity == null && !string.IsNullOrEmpty(cmd) && ToolMobile.getEnvironment() != null) { activity = ToolMobile.getEnvironment().toActivity(cmd, null); } if (activity != null) { return(activity.done()); } return(null); }
/////////////////////////////////////////////////////////////////////////////////////////// #region Start void MobFormMain_Creating(object sender, EventArgs e) { addActivityExt(this);//dontwait resume //ToolMobile.setContext(this); // MobEnvironment.startEnv(); // if (inited) { if (ToolMobile.getEnvironment() == null) { ToolMsg.show(this, "Cant start", delegate() { Close(); }); } } }
private static string translate(string txt) { return(ToolMobile.getEnvironment().translate(txt)); }
protected override void initAfterSettings() { base.initAfterSettings(); getGrid().isSortEnabled = true; getGrid().userDesc = "Main Grid"; // topMessanger = new UserMessangerParentControlText(this); //check take from referense ImplDataReference ref_ = ToolMobile.getEnvironment().getReference(this.Intent.GetStringExtra(ConstCmdLine.cmd)) as ImplDataReference; if (ref_ != null) { this.setSource(ref_.getPagedSource()); reference = ref_; if (reference.getReferenceMode() != null && reference.getReferenceMode().batchModeIndexes != null) { string[] indx_ = reference.getReferenceMode().batchModeIndexes; if (indx_.Length > 0 && !string.IsNullOrEmpty(indx_[0])) { getBtnOk().Text = indx_[0]; } } } getBtnCancel().Click += BtnCancel_Click; getBtnOk().Click += BtnOk_Click; getBtnClean().Click += BtnClean_Click; getBtnSearch().Click += BtnSearch_Click; getBtnAdd().Click += BtnAdd_Click; ////////////////////////////// getBtnOk().Visible = !showMode; getBtnAdd().Visible = canAdd(); try { stopRefreshOnFilterChanged = true; getGrid().beginDataLoad(); loadFilterStruct(); loadFilterData(); refresh(); loadRecordId(); } finally { stopRefreshOnFilterChanged = false; getGrid().endDataLoad(); } getGrid().RowClick += MobDataReferenceGridFormBase_RowClick; getGrid().RowLongClick += MobDataReferenceGridFormBase_RowLongClick; getGrid().RowSelected += MobDataReferenceGridFormBase_RowSelected; // // RegisterForContextMenu(getGrid()); //before adapter getBtnMenu().Click += MobDataReferenceGridFormBase_Click; // string col_ = Intent.GetStringExtra(TableDUMMY.COLUMN); string val_ = Intent.GetStringExtra(TableDUMMY.VALUE); if (col_ != null && !string.IsNullOrEmpty(val_)) { this.extender.requiredSortedData(col_, true); this.extender.searchData(val_); } getQuiqFilterPanel().Visible = (getQuiqFilterColumn(null) != null); getQuiqFilterText().KeyPress += QuiqFilterText_KeyPress; }
protected virtual CmdMenuItem[] createMenuItems() { List <CmdMenuItem> list = new List <CmdMenuItem>(); list = new List <CmdMenuItem>(); // if (reference != null && reference.getReferenceMode() != null && reference.getReferenceMode().batchModeIndexes != null) { string[] indx_ = reference.getReferenceMode().batchModeIndexes; //0 bound to Ok button //if (indx_.Length > 0) // list.Add(new CmdMenuItem() { CmdType = CmdType.batch1, Text = ToolMobile.getEnvironment().translate(indx_[0]) }); if (indx_.Length > 1) { list.Add(new CmdMenuItem() { CmdType = CmdType.batch2, Text = ToolMobile.getEnvironment().translate(indx_[1]) }); } if (indx_.Length > 2) { list.Add(new CmdMenuItem() { CmdType = CmdType.batch3, Text = ToolMobile.getEnvironment().translate(indx_[2]) }); } if (indx_.Length > 3) { list.Add(new CmdMenuItem() { CmdType = CmdType.batch4, Text = ToolMobile.getEnvironment().translate(indx_[3]) }); } if (indx_.Length > 4) { list.Add(new CmdMenuItem() { CmdType = CmdType.batch5, Text = ToolMobile.getEnvironment().translate(indx_[4]) }); } } // list.Add(new CmdMenuItem() { CmdType = CmdType.refresh, Text = ToolMobile.getEnvironment().translate(WordCollection.T_REFRESH) }); list.Add(new CmdMenuItem() { CmdType = CmdType.add, Text = ToolMobile.getEnvironment().translate(WordCollection.T_ADD) }); list.Add(new CmdMenuItem() { CmdType = CmdType.view, Text = ToolMobile.getEnvironment().translate(WordCollection.T_VIEW) }); list.Add(new CmdMenuItem() { CmdType = CmdType.edit, Text = ToolMobile.getEnvironment().translate(WordCollection.T_EDIT) }); list.Add(new CmdMenuItem() { CmdType = CmdType.copy, Text = ToolMobile.getEnvironment().translate(WordCollection.T_COPY) }); list.Add(new CmdMenuItem() { CmdType = CmdType.delete, Text = ToolMobile.getEnvironment().translate(WordCollection.T_DELETE) }); string infoList = settings.getString("INFO_SOURCE"); if (infoList != string.Empty) { string[] arr = ToolString.explodeList(infoList); int indx_ = 0; foreach (string srcName in arr) { string text = ToolMobile.getEnvironment().translate(settings.getStringAttr(srcName, "name")); string location = settings.getStringAttr(srcName, "location"); string[] arrParm = ToolString.explodeList(settings.getStringAttr(srcName, "params")); string[] arrCols = ToolString.explodeList(settings.getStringAttr(srcName, "cols")); IActivity activity_ = new RefMenuItemActivity(ToolMobile.getEnvironment(), (IRowSource)getGrid(), location, arrParm, arrCols); list.Add(new CmdMenuItem() { CmdType = (CmdType)((int)CmdType.info1 + indx_), Text = text, activity = activity_ }); ++indx_; } } return(list.ToArray()); }
public object recordIdLoad() { object val_ = ToolMobile.getEnvironment().getStateRuntime(stateRecordId) as object; return(val_); }
public void filterSave(string[] cols, object[] vals) { ToolMobile.getEnvironment().setStateRuntime(stateFilterCols, cols); ToolMobile.getEnvironment().setStateRuntime(stateFilterVal, vals); }