示例#1
0
        private DataTable BuildOtherDialogFromMap()
        {
            DataTable dt = new DataTable("Face Components Table");

            dt.Columns.Add(" ", typeof(string));

            dt.Columns.Add(FaceComponent.Outlines.GetEnumDescription(), typeof(Boolean));
            dt.Columns.Add(FaceComponent.EyesOpen.GetEnumDescription(), typeof(Boolean));
            dt.Columns.Add(FaceComponent.EyesClosed.GetEnumDescription(), typeof(Boolean));

            dt.Columns.Add(COLOR_COLUMN_NAME, typeof(System.Drawing.Color));

            foreach (var element in _targetNodes)
            {
                DataRow dr = dt.Rows.Add();
                dr[0] = element.Name;
                var fm = FaceModule.GetFaceModuleForElement(element);
                foreach (FaceComponent key in Enum.GetValues(typeof(FaceComponent)))
                {
                    if (key == FaceComponent.Mouth)
                    {
                        continue;
                    }
                    bool result;
                    if (fm != null && fm.FaceComponents.TryGetValue(key, out result))
                    {
                        dr[key.GetEnumDescription()] = result;
                    }
                    else
                    {
                        dr[key.GetEnumDescription()] = false;
                    }
                }
                dr[COLOR_COLUMN_NAME] = fm?.DefaultColor ?? System.Drawing.Color.White;
            }

            dt.Columns[" "].ReadOnly = true;
            dt.Columns[COLOR_COLUMN_NAME].ReadOnly = true;

            return(dt);
        }
示例#2
0
        private DataTable BuildMouthDialogFromMap()
        {
            DataTable dt = new DataTable("Mouth Table");

            dt.Columns.Add(" ", typeof(string));

            foreach (string key in _phonemeBitmaps.Keys)
            {
                dt.Columns.Add(key, typeof(Boolean));
            }

            dt.Columns.Add(COLOR_COLUMN_NAME, typeof(System.Drawing.Color));

            foreach (var element in _targetNodes)
            {
                var fm = FaceModule.GetFaceModuleForElement(element);

                DataRow dr = dt.Rows.Add();
                dr[0] = element.Name;

                foreach (string key in _phonemeBitmaps.Keys)
                {
                    bool result;
                    if (fm != null && fm.PhonemeList.TryGetValue(key, out result))
                    {
                        dr[key] = result;
                    }
                    else
                    {
                        dr[key] = false;
                    }
                }
                dr[COLOR_COLUMN_NAME] = fm?.DefaultColor ?? System.Drawing.Color.White;
            }

            dt.Columns[" "].ReadOnly = true;
            dt.Columns[COLOR_COLUMN_NAME].ReadOnly = true;

            return(dt);
        }