void executor_SaveApplicationData(WfExecutorDataContext dataContext) { if (Scene.Current.SceneID == "First_Default") { var process = dataContext.CurrentProcess; var properties = this.propertyForm.Properties; var imgProStr = properties.GetValue("Image", ""); if (imgProStr != "") { ImageProperty imgPro = JSONSerializerExecute.Deserialize <ImageProperty>(imgProStr); if (imgPro.Changed) { ImagePropertyAdapter.Instance.UpdateWithContent(imgPro); properties.SetValue("Image", JSONSerializerExecute.Serialize(imgPro)); } } var deltaData = MaterialControl.GetCommonDeltaMaterials(); MaterialAdapter.Instance.SaveCommonDeltaMaterials(deltaData); //DynamicFormDataAdapter.Instance.Update(this.ViewData.Data); this.ViewData.Data.Properties = properties; process.RootProcess.Context["appData"] = SerializationHelper.SerializeObjectToString(this.ViewData.Data, SerializationFormatterType.Binary); } }
protected void Control_click(object sender, EventArgs e) { MaterialControl mc = (MaterialControl)sender; KubixAdmin.Material tempMaterial = null; foreach (KubixAdmin.Material material in context.Materials.Local) { if (material.MaterialID == mc.MaterialID) { tempMaterial = material; } } if (tempMaterial != null) { Application.Current.MainWindow.Content = new Material(tempMaterial); } }
public void DrawTile(int matnumber) { foreach (Position pos in boardManager.possibleMovePositions) { string tileName = GetTileName(pos.x, pos.y); //Debug.Log(tileName); GameObject current_tile = GameObject.Find(tileName); MaterialControl current_matcontrol = current_tile.GetComponent <MaterialControl>(); Material[] mat = { current_matcontrol.material_list[matnumber] }; current_tile.GetComponent <MeshRenderer>().materials = mat; } piece_selected = GameObject.Find("0 6").GetComponent <Piece_new>(); piece_selected.Selected(); foreach (Move_new move in piece_selected.moves) { Debug.Log(move.secondPosition.Position.x); Debug.Log(move.secondPosition.Position.y); } }
public Materials() { InitializeComponent(); context = new KubixDBEntities(); context.Materials.Load(); BitmapImage imgsrc = new BitmapImage(new Uri("/Images/icon_user_primary.png", UriKind.Relative)); enable = (Style)FindResource("ButtonPrimary"); disable = (Style)FindResource("ButtonPrimaryDisabled"); foreach (var matr in context.Materials.Local) { MaterialControl mat = new MaterialControl(); mat.MaterialName = matr.Name; mat.MaterialDescription = matr.Description; mat.MaterialUnitMeasurement = matr.UnitMeasurement; mat.MaterialUnitPrice = matr.UnitPrice.ToString() + " euros."; mat.MaterialType = matr.Type; mat.Control_Click += new EventHandler(Control_click); mat.MaterialID = matr.MaterialID; rpsGridMaterials.Children.Add(mat); } }
private void InitMaterialControls(HtmlGenericControl div) { for (int i = 0; i < this.Columns.Count; i++) { var column = this.columns[i]; if (column.EditTemplate.EditMode == ClientGridColumnEditMode.Material) { if (column.EditTemplate.TemplateControlID.IsNullOrEmpty() && column.EditTemplate.TemplateControlClientID.IsNullOrEmpty()) { MaterialControl materialControl = new MaterialControl() { ID = "ClientGrid_MaterialControl_Template_" + i }; div.Controls.Add(materialControl); column.EditTemplate.TemplateControlID = materialControl.ID; if (column.EditTemplate.TemplateControlSettings.IsNotEmpty()) { Dictionary <string, string> dictionary = JSONSerializerExecute.Deserialize <Dictionary <string, string> >(column.EditTemplate.TemplateControlSettings); foreach (var key in dictionary.Keys) { switch (key) { case "rootPathName": materialControl.RootPathName = dictionary[key]; break; case "materialUseMode": materialControl.MaterialUseMode = (MaterialUseMode)Enum.Parse(typeof(MaterialUseMode), dictionary[key]); break; case "fileSelectMode": materialControl.FileSelectMode = (FileSelectMode)Enum.Parse(typeof(FileSelectMode), dictionary[key]); break; case "templateUrl": materialControl.TemplateUrl = dictionary[key]; break; case "allowEdit": materialControl.AllowEdit = bool.Parse(dictionary[key]); break; case "allowEditContent": materialControl.AllowEditContent = bool.Parse(dictionary[key]); break; case "caption": materialControl.Caption = dictionary[key]; break; case "materialTitle": materialControl.MaterialTitle = dictionary[key]; break; case "displayText": materialControl.DisplayText = dictionary[key]; break; case "editText": materialControl.EditText = dictionary[key]; break; case "draftText": materialControl.DraftText = dictionary[key]; break; case "editDocumentInCurrentPage": materialControl.EditDocumentInCurrentPage = bool.Parse(dictionary[key]); break; default: break; } } } } } } }
protected void btnPostBack_Click(object sender, EventArgs e) { var data = gridTest.InitialData; var deltaData = MaterialControl.GetCommonDeltaMaterials(); }
protected void Button1_Click(object sender, EventArgs e) { var data = MaterialControl.GetCommonDeltaMaterials(); }
void Start() { materialControl = GetComponent <MaterialControl>(); }
private void Awake() { instance = this; }