public override EventPropertyWriterSPI GetWriter(string propertyName) { if (_writablePropertyDescriptors == null) { InitializeWriters(); } var pair = _propertyWriters.Get(propertyName); if (pair != null) { return pair.Second; } var property = PropertyParser.ParseAndWalkLaxToSimple(propertyName); if (property is MappedProperty mapProp) { if (!PropertyItems.ContainsKey(mapProp.PropertyNameAtomic)) { return null; } return new MapEventBeanPropertyWriterMapProp(mapProp.PropertyNameAtomic, mapProp.Key); } if (property is IndexedProperty indexedProp) { if (!PropertyItems.ContainsKey(indexedProp.PropertyNameAtomic)) { return null; } return new MapEventBeanPropertyWriterIndexedProp(indexedProp.PropertyNameAtomic, indexedProp.Index); } return null; }
private async void searchPropertyDetails(object sender, SelectedItemChangedEventArgs e) { PropertyItems property = (sender as ListView).SelectedItem as PropertyItems; RealEstateXamarin.Models.PropertyDetails propertyDetails = await HttpUtils.GetPropertyDetails(property.id + ""); await Navigation.PushAsync(new PropertyDetails(propertyDetails)); }
private void mLoadValues(ref StringBuilder sb, Subjects subject) { sb.Append(columnsStartDiv); sb.Append(string.Format("<img width='100px' height='100px' src='{0}' style='margin: 30px 0 0 30px;'></img>", mGetCoverImage(subject.pIDSubject.ToString()))); string resultValue = Farschidus.Translator.AppTranslate["general.label.na"]; List <string> valueList = new List <string>(); List <int> propertyIDs = new List <int>(); mLoadRecursivlyByParentID(ref propertyIDs, subject.pIDSubject); Properties properties = new Properties(); properties.LoadAll(); properties.Filter = string.Format("{0} IN ({1})", Properties.ColumnNames.IDProperty, string.Join(",", propertyIDs.ToArray())); if (properties.RowCount > 0) { do { SubjectPropertyValues subjectPropertyValue = new SubjectPropertyValues(subject.pIDSubject, properties.pIDProperty); if (subjectPropertyValue.RowCount > 0) { if (properties.pIDType.Equals((byte)PropertyTypes.Enum.date) && pCurrentLanguageID == 2) { resultValue = Global.MethodsAndProps.mToFarsiDigit(new Farschidus.JalaliDateTime(Convert.ToDateTime(subjectPropertyValue.pValue)).ToShortDateString()); } else if (properties.pIDType.Equals((byte)PropertyTypes.Enum.dateTime) && pCurrentLanguageID == 2) { resultValue = Global.MethodsAndProps.mToFarsiDigit(new Farschidus.JalaliDateTime(Convert.ToDateTime(subjectPropertyValue.pValue.Split(' ')[0])).ToShortDateString()); } if (properties.pIDType.Equals((byte)PropertyTypes.Enum.singleSelect)) { PropertyItems items = new PropertyItems(); items.LoadByIDProperty((int)properties.pIDProperty); items.Filter = string.Format("{0} IN ({1})", PropertyItems.ColumnNames.IDPropertyItem, subjectPropertyValue.pValue); resultValue = items.pTitle; } else { resultValue = subjectPropertyValue.pValue; } } else { resultValue = Farschidus.Translator.AppTranslate["general.label.na"]; } valueList.Add(resultValue); }while (properties.MoveNext()); foreach (string val in valueList) { //sb.Append(string.Format("{0}<br/>", val)); sb.AppendFormat("<div style='background-color: #f0f0f0; color: #3c3c3c; border-bottom: 1px solid #fff; padding: 5px;'>{0}<br/></div>", val); } } sb.Append(columnsEndDiv); }
private void mFillForm() { PropertyItems propertyItems = new PropertyItems(pIDPropertyItem.Value); //txtIDPropertyItem.Text = propertyItems.pIDPropertyItem; //txtIDProperty.Text = propertyItems.pIDProperty; txtTitle.Text = propertyItems.pTitle; uplAddEdit.Update(); }
protected void grvSingleSelectItems_RowEditing(object sender, GridViewEditEventArgs e) { grvSingleSelectItems.EditIndex = e.NewEditIndex; PropertyItems propertyItems = new PropertyItems(); propertyItems = pPropertyItems; grvSingleSelectItems.DataSource = propertyItems.DefaultView; grvSingleSelectItems.DataBind(); }
protected virtual void BuildPropertyItemList() { foreach (var propertyItem in PropertyItems) { propertyItem.Dispose(); } PropertyItems.Clear(); PropertyItems.AddRange(PropertyGridItemFactory.GetPropertyItems(Property.GetValue(Instance))); Properties.Refresh(); }
private void mLoadAll() { int itemCount = 0; PropertyItems propertyItems = new PropertyItems(); propertyItems.LoadAll(listPager.CurrentIndex - 1, listPager.PageSize, ref itemCount, null); listPager.ItemCount = itemCount; grvList.DataSource = propertyItems.DefaultView; grvList.DataBind(); uplList.Update(); }
private void mSaveItem(int idProperty) { PropertyItems propertyItems = new PropertyItems(); propertyItems = pPropertyItems; if (propertyItems.RowCount > 0) { do { propertyItems.pIDProperty = idProperty; }while (propertyItems.MoveNext()); } propertyItems.Save(); }
protected override void BuildPropertyItemList() { var enumerable = Property.GetValue(Instance) as IEnumerable; if (enumerable != null) { int index = 0; foreach (object instance in enumerable) { PropertyItems.Add(new ListItemPropertyItem(instance, index++)); } } Properties.Refresh(); }
protected void btnAddItem_Click(object sender, EventArgs e) { PropertyItems propertyItems = new PropertyItems(); propertyItems = pPropertyItems; propertyItems.AddNew(); propertyItems.pTitle = txtSingleSelectItem.Text; pPropertyItems = propertyItems; grvSingleSelectItems.DataSource = pPropertyItems.DefaultView; grvSingleSelectItems.DataBind(); txtSingleSelectItem.Text = string.Empty; }
private void mDelete(int iDProperty, bool loadList = true) { if (mValidateDelete(iDProperty)) { try { Properties properties = new Properties(iDProperty); PropertyItems propertyItem = new PropertyItems(); SubjectPropertyValues SubjectPropertyValue = new SubjectPropertyValues(); SubjectPropertyValue.LoadByIDProperty(iDProperty); if (SubjectPropertyValue.RowCount > 0) { SubjectPropertyValue.DeleteAll(); SubjectPropertyValue.Save(); } propertyItem.LoadByIDProperty(iDProperty); if (propertyItem.RowCount > 0) { propertyItem.DeleteAll(); propertyItem.Save(); } properties.MarkAsDeleted(false); properties.Save(); if (loadList) { pMessage.Clear(); pMessage.Add(Farschidus.Translator.AppTranslate["general.message.deleted"], Farschidus.Web.UI.Message.MessageTypes.Success); mShowMessage(pMessage); mLoadAll(); } } catch (Exception ex) { pMessage.Clear(); pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error); mShowMessage(pMessage); } } mShowMessage(pMessage); }
protected void grvSingleSelectItems_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Save") { int index = grvSingleSelectItems.EditIndex; GridViewRow row = grvSingleSelectItems.Rows[index]; TextBox itemTitle = (TextBox)row.FindControl("txtGridItemTitle"); PropertyItems propertyItems = new PropertyItems(); propertyItems = pPropertyItems; propertyItems.MoveTo(index); propertyItems.pTitle = itemTitle.Text; pPropertyItems = propertyItems; grvSingleSelectItems.EditIndex = -1; grvSingleSelectItems.DataSource = pPropertyItems.DefaultView; grvSingleSelectItems.DataBind(); } }
private void mSave() { if (mValidateAddEdit()) { try { PropertyItems propertyItems = new PropertyItems(); if (pIDPropertyItem.HasValue) { propertyItems.LoadByPrimaryKey(pIDPropertyItem.Value); } else { propertyItems.AddNew(); } //propertyItems.pIDPropertyItem = txtIDPropertyItem.Text; //propertyItems.pIDProperty = txtIDProperty.Text; propertyItems.pTitle = txtTitle.Text; propertyItems.Save(); pMessage.Clear(); pMessage.Add(Farschidus.Translator.AppTranslate["message.addEdit.success"], Farschidus.Web.UI.Message.MessageTypes.Success); mShowMessage(pMessage); if (!pIDPropertyItem.HasValue) { mClear(); } } catch (Exception ex) { pMessage.Clear(); pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error); mShowMessage(pMessage); } } else { mShowMessage(pMessage); } }
private void mDelete(int iDPropertyItem) { try { PropertyItems propertyItems = new PropertyItems(iDPropertyItem); propertyItems.MarkAsDeleted(false); pMessage.Clear(); pMessage.Add(Farschidus.Translator.AppTranslate["message.delete.success"], Farschidus.Web.UI.Message.MessageTypes.Success); mShowMessage(pMessage); propertyItems.Save(); mLoadList(); } catch (Exception ex) { pMessage.Clear(); pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error); mShowMessage(pMessage); } }
protected void grvSingleSelectItems_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { PropertyItems propertyItems = new PropertyItems(); propertyItems = pPropertyItems; propertyItems.MoveTo(e.RowIndex); propertyItems.MarkAsDeleted(false); pPropertyItems = propertyItems; grvSingleSelectItems.DataSource = pPropertyItems.DefaultView; grvSingleSelectItems.DataBind(); uplAddEdit.Update(); } catch (Exception ex) { pMessage.Clear(); pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error); mShowMessage(pMessage); } }
private void mSearch() { int itemCount = 0; PropertyItems propertyItems = new PropertyItems(); string title = ""; if (!string.IsNullOrEmpty(txtTitleSearch.Text)) { title = txtTitleSearch.Text.Trim(); } propertyItems.Search(listPager.CurrentIndex - 1, listPager.PageSize, ref itemCount, null, null, title, null); listPager.ItemCount = itemCount; grvList.DataSource = propertyItems.DefaultView; grvList.DataBind(); uplList.Update(); }
private void mSetTableVisibility(PropertyTypes.Enum selectedType) { switch (selectedType) { case PropertyTypes.Enum.text: case PropertyTypes.Enum.integer: case PropertyTypes.Enum.floati: case PropertyTypes.Enum.trueFalse: case PropertyTypes.Enum.date: case PropertyTypes.Enum.time: case PropertyTypes.Enum.dateTime: case PropertyTypes.Enum.image: { trSingleSelectItem.Visible = trItems.Visible = false; break; } case PropertyTypes.Enum.singleSelect: case PropertyTypes.Enum.multiSelect: { pPropertyItems.DeleteAll(); trSingleSelectItem.Visible = trItems.Visible = true; PropertyItems propertyItems = new PropertyItems(); if (pIDProperty.HasValue) { propertyItems.LoadByIDProperty(pIDProperty.Value); } pPropertyItems = propertyItems; txtSingleSelectItem.Text = ""; grvSingleSelectItems.DataSource = pPropertyItems.DefaultView; grvSingleSelectItems.DataBind(); break; } } }
public PropertyPanel(PropertyItems properties) : base() { this.properties = properties; txt = ""; }
public string mGetCorrectValue(object IDProperty, string strValue) { string result = strValue; Properties property = new Properties((int)IDProperty); PropertyTypes.Enum type = (PropertyTypes.Enum)Enum.Parse(typeof(PropertyTypes.Enum), property.pIDType.ToString()); switch (type) { case PropertyTypes.Enum.date: { if (pLanguageID.Equals(2)) { result = Global.MethodsAndProps.mToFarsiDigit(new Farschidus.JalaliDateTime(Convert.ToDateTime(strValue)).ToShortDateString()); } break; } case PropertyTypes.Enum.dateTime: { if (pLanguageID.Equals(2)) { result = Global.MethodsAndProps.mToFarsiDigit(new Farschidus.JalaliDateTime(Convert.ToDateTime(strValue)).ToString()); } break; } case PropertyTypes.Enum.singleSelect: { PropertyItems items = new PropertyItems(); items.LoadByIDProperty((int)IDProperty); items.Filter = string.Format("{0} IN ({1})", PropertyItems.ColumnNames.IDPropertyItem, strValue); result = items.pTitle; break; } case PropertyTypes.Enum.multiSelect: { char seperator; if (pLanguageID.Equals(2)) { seperator = '،'; } else { seperator = ','; } result = string.Empty; PropertyItems items = new PropertyItems(); items.LoadByIDProperty((int)IDProperty); if (items.RowCount > 0) { items.Filter = string.Format("{0} IN ({1})", PropertyItems.ColumnNames.IDPropertyItem, strValue); do { result += items.pTitle + seperator + " "; }while (items.MoveNext()); result = result.Substring(0, result.LastIndexOf(seperator)); } break; } case PropertyTypes.Enum.trueFalse: { if (strValue == "True") { result = Global.Constants.HTML_IMAGE_CHECK; } else { result = Global.Constants.HTML_IMAGE_ERROR; } break; } } return(result); }
private void mFillForm(PropertyTypes.Enum selectedType, int idProperty) { string strValue = string.Empty; SubjectPropertyValues subjectPropertyValues = new SubjectPropertyValues(pSubjectID, idProperty); if (subjectPropertyValues.RowCount > 0) { strValue = subjectPropertyValues.pValue; } switch (selectedType) { case PropertyTypes.Enum.text: { trText.Visible = true; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = false; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = false; txtText.Text = strValue; break; } case PropertyTypes.Enum.integer: { trText.Visible = false; trInteger.Visible = true; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = false; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = false; txtInteger.Text = strValue; break; } case PropertyTypes.Enum.floati: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = true; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = false; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = false; txtFloati.Text = strValue; break; } case PropertyTypes.Enum.singleSelect: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = true; trMultiSelect.Visible = false; trTrueFalse.Visible = false; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = false; PropertyItems propertyItem = new PropertyItems(); propertyItem.LoadByIDProperty(idProperty); rblSingleSelect.DataSource = propertyItem.DefaultView; rblSingleSelect.DataTextField = PropertyItems.ColumnNames.Title; rblSingleSelect.DataValueField = PropertyItems.ColumnNames.IDPropertyItem; rblSingleSelect.DataBind(); if (!string.IsNullOrEmpty(strValue)) { rblSingleSelect.SelectedValue = strValue; } break; } case PropertyTypes.Enum.multiSelect: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = true; trTrueFalse.Visible = false; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = false; PropertyItems propertyItem = new PropertyItems(); propertyItem.LoadByIDProperty(idProperty); grvMultiSelect.DataSource = propertyItem.DefaultView; grvMultiSelect.DataBind(); if (!string.IsNullOrEmpty(strValue)) { string[] values = strValue.Split(','); foreach (string val in values) { foreach (GridViewRow grvRow in grvMultiSelect.Rows) { if (val.Equals(grvMultiSelect.DataKeys[grvRow.RowIndex][PropertyItems.ColumnNames.IDPropertyItem].ToString())) { ((CheckBox)grvRow.FindControl("chkItemsList")).Checked = true; break; } } } } break; } case PropertyTypes.Enum.trueFalse: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = true; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = false; if (!string.IsNullOrEmpty(strValue)) { chbTrueFalse.Checked = Convert.ToBoolean(strValue); } break; } case PropertyTypes.Enum.date: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = false; if (pLanguageID == 2) { trDatePe.Visible = true; trDate.Visible = false; if (!string.IsNullOrEmpty(strValue)) { ucJalaliDatePiker.JalaliDate = new Farschidus.JalaliDateTime(Convert.ToDateTime(strValue)).ToShortDateString(); } } else { trDatePe.Visible = false; trDate.Visible = true; if (!string.IsNullOrEmpty(strValue)) { txtDate.Text = strValue; } } trTime.Visible = false; break; } case PropertyTypes.Enum.time: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = false; trDate.Visible = false; trDatePe.Visible = false; trTime.Visible = true; txtTime.Text = strValue; break; } case PropertyTypes.Enum.dateTime: { trText.Visible = false; trInteger.Visible = false; trFloati.Visible = false; trSingleSelect.Visible = false; trMultiSelect.Visible = false; trTrueFalse.Visible = false; if (pLanguageID.Equals(2)) { trDatePe.Visible = true; trDate.Visible = false; if (!string.IsNullOrEmpty(strValue)) { ucJalaliDatePiker.JalaliDate = new Farschidus.JalaliDateTime(Convert.ToDateTime(strValue.Split(' ')[0])).ToShortDateString(); } } else { trDatePe.Visible = false; trDate.Visible = true; if (!string.IsNullOrEmpty(strValue)) { txtDate.Text = strValue.Split(' ')[0]; } } trTime.Visible = true; if (!string.IsNullOrEmpty(strValue)) { txtTime.Text = strValue.Split(' ')[1]; } break; } } uplAddEdit.Update(); }
public ExtendedImagePanel(PropertyItems properties) : base() { this.properties = properties; }
private void Init(int index, VideoFormat format) { //---------------------------------- // Create Filter Graph //---------------------------------- // +--------------------+ +----------------+ +---------------+ // |Video Capture Source|→| Sample Grabber |→| Null Renderer | // +--------------------+ +----------------+ +---------------+ // ↓GetBitmap() var graph = DirectShow.CreateGraph(); //---------------------------------- // VideoCaptureSource //---------------------------------- var vcap_source = CreateVideoCaptureSource(index, format); graph.AddFilter(vcap_source, "VideoCapture"); //------------------------------ // SampleGrabber //------------------------------ var grabber = CreateSampleGrabber(); graph.AddFilter(grabber, "SampleGrabber"); var i_grabber = (DirectShow.ISampleGrabber)grabber; i_grabber.SetBufferSamples(true); //サンプルグラバでのサンプリングを開始 //--------------------------------------------------- // Null Renderer //--------------------------------------------------- var renderer = DirectShow.CoCreateInstance(DirectShow.DsGuid.CLSID_NullRenderer) as DirectShow.IBaseFilter; graph.AddFilter(renderer, "NullRenderer"); //--------------------------------------------------- // Create Filter Graph //--------------------------------------------------- var builder = DirectShow.CoCreateInstance(DirectShow.DsGuid.CLSID_CaptureGraphBuilder2) as DirectShow.ICaptureGraphBuilder2; builder.SetFiltergraph(graph); var pinCategory = DirectShow.DsGuid.PIN_CATEGORY_CAPTURE; var mediaType = DirectShow.DsGuid.MEDIATYPE_Video; builder.RenderStream(ref pinCategory, ref mediaType, vcap_source, grabber, renderer); // SampleGrabber Format. { var mt = new DirectShow.AM_MEDIA_TYPE(); i_grabber.GetConnectedMediaType(mt); var header = (DirectShow.VIDEOINFOHEADER)Marshal.PtrToStructure(mt.pbFormat, typeof(DirectShow.VIDEOINFOHEADER)); var width = header.bmiHeader.biWidth; var height = header.bmiHeader.biHeight; var stride = width * (header.bmiHeader.biBitCount / 8); DirectShow.DeleteMediaType(ref mt); Size = new Size(width, height); // fix screen tearing problem(issue #2) // you can use previous method if you swap the comment line below. // GetBitmap = () => GetBitmapFromSampleGrabberBuffer(i_grabber, width, height, stride); GetBitmap = GetBitmapFromSampleGrabberCallback(i_grabber, width, height, stride); } // Assign Delegates. Start = () => DirectShow.PlayGraph(graph, DirectShow.FILTER_STATE.Running); Stop = () => DirectShow.PlayGraph(graph, DirectShow.FILTER_STATE.Stopped); Release = () => { Stop(); DirectShow.ReleaseInstance(ref i_grabber); DirectShow.ReleaseInstance(ref builder); DirectShow.ReleaseInstance(ref graph); }; // Properties. Properties = new PropertyItems(vcap_source); }
public GraphItem(PropertyItems properties) : base(properties) { }