void ViewFragment(AnimationFragment fragment, bool canEdit = false)
 {
     if (fragment != null)
     {
         var view = AnimationFragmentViewModel.CreateFromFragment(_pfs, fragment, canEdit);
         TableWindow.Show(view);
     }
 }
 private void Classification_Click(object sender, RoutedEventArgs e)
 {
     if (dataModel != null)
     {
         init_intvscell();
         TableWindow tblWindow = new TableWindow(intvscell, classification: true);
         tblWindow.Show();
     }
 }
示例#3
0
        public void OnEditButton()
        {
            //CBaseObjectMgr BaseObjectMgr = new CBaseObjectMgr();
            //BaseObjectMgr.TbCode = "UI_NavigateBarButton";
            //BaseObjectMgr.Ctx = Program.Ctx;

            TableWindow frm = new TableWindow(WindowControl.NavigateBarButtonMgr);

            frm.ShowDialog();

            LoadData();
        }
示例#4
0
 public CreateTable()
 {
     if ((Data.RKK_File_Path != null) && (Data.Appeal_File_Path != null))
     {
         TableWindow taskWindow = new TableWindow();
         taskWindow.Show();
     }
     else
     {
         ErrorMessege Error = new ErrorMessege();
         Error.Show();
     }
 }
示例#5
0
        private void tbtData_Click(object sender, EventArgs e)
        {
            if (listTable.SelectedItems.Count == 0)
            {
                MessageBox.Show("请选择一项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            CTable table = (CTable)listTable.SelectedItems[0].Tag;

            CBaseObjectMgr BaseObjectMgr = new CBaseObjectMgr();

            BaseObjectMgr.TbCode = table.Code;
            BaseObjectMgr.Ctx    = Program.Ctx;

            TableWindow frm = new TableWindow(BaseObjectMgr);

            frm.ShowDialog();
        }
        /// <summary>
        /// 初始化餐桌定位页面
        /// </summary>
        public void InitTableLocation()
        {
            TableXaml = new TableWindow();
            Config config = _ConfigurationService.Find(TableLocationMapping.TableLocationName[TableLocation.NAME]);

            if (config != null)
            {
                string[] value = config.Value.Split(new char[] { '_' });
                //餐桌定位的拼接类型是编码或者id直接使用下划线分割"_"
                if (config.Disabled == 1)   //餐桌类型
                {
                    TableXaml.TableType.IsChecked = true;
                    LoaderTableTypeLocation(value);
                }
                else if (config.Disabled == 2)   //区域
                {
                    TableXaml.Location.IsChecked = true;
                    LoaderTableLocation(value);
                }
            }
            TableXaml.ShowDialog();
        }
示例#7
0
        public static void ViewTemperatureForecast(int tileId, int dateTicks)
        {
            /*
             * Forecast for twelves of year.
             */
            var tempsForTwelves = TemperatureData.TemperaturesForTwelfth(tileId);
            var twelvesGetters  = new List <ColumnData <TemperatureForecastForTwelfth> >
            {
                new ColumnData <TemperatureForecastForTwelfth>("PLTFW_Quadrum".Translate(), "PLTFW_QuadrumToolTip".Translate(),
                                                               tfft => $"{tfft.Twelfth.GetQuadrum()}"),
                new ColumnData <TemperatureForecastForTwelfth>("PLTFW_Season".Translate(), "PLTFW_SeasonToolTip".Translate(),
                                                               tfft => $"{tfft.Twelfth.GetQuadrum().GetSeason(tfft.Latitude)}"),
                new ColumnData <TemperatureForecastForTwelfth>("PLTFW_Twelfth".Translate(), "PLTFW_TwelfthToolTip".Translate(),
                                                               tfft => $"{tfft.Twelfth}"),
                new ColumnData <TemperatureForecastForTwelfth>("PLTFW_AvgTemp".Translate(), "PLTFW_AvgTempToolTip".Translate(),
                                                               tfft => $"{tfft.AverageTemperatureForTwelfth:F2}")
            };
            var tableViewTempForTwelves =
                new TableView <TemperatureForecastForTwelfth>("PLTFW_ForecastForTwelves".Translate(), tempsForTwelves,
                                                              twelvesGetters);


            var dateString = GenDate.DateReadoutStringAt(dateTicks, Find.WorldGrid.LongLatOf(tileId));

            /*
             * Forecast for hours of day
             */
            var temperaturesForHoursOfDay =
                TemperatureData.TemperaturesForDay(tileId, dateTicks);
            var temperaturesForHoursGetters = new List <ColumnData <TemperatureForecastForDay> >
            {
                new ColumnData <TemperatureForecastForDay>("PLTFW_Hour".Translate(), "PLTFW_HourToolTip".Translate(), tffd => $"{tffd.Hour}"),
                new ColumnData <TemperatureForecastForDay>("PLTFW_OutdoorTemp".Translate(), "PLTFW_OutdoorTempToolTip".Translate(),
                                                           tffd => $"{tffd.OutdoorTemperature:F1}"),
                //new ColumnData<TemperatureForecastForDay>("RandomVar", "Daily Random Variation", tffd => $"{tffd.DailyRandomVariation:F1}"),
                new ColumnData <TemperatureForecastForDay>("PLTFW_OffDRV".Translate(), "PLTFW_OffDRVToolTip".Translate(),
                                                           tffd => $"{tffd.OffsetFromDailyRandomVariation:F1}"),
                new ColumnData <TemperatureForecastForDay>("PLTFW_OffSeason".Translate(), "PLTFW_OffSeasonToolTip".Translate(),
                                                           tffd => $"{tffd.OffsetFromSeasonCycle:F1}"),
                new ColumnData <TemperatureForecastForDay>("PLTFW_SunEff".Translate(), "PLTFW_SunEffToolTip".Translate(),
                                                           tffd => $"{tffd.OffsetFromSunCycle:F1}")
            };

            var tableName           = string.Format("PLTFW_ForecastForHours".Translate(), GenDate.HoursPerDay, dateString);
            var tableViewTempForDay =
                new TableView <TemperatureForecastForDay>(tableName, temperaturesForHoursOfDay,
                                                          temperaturesForHoursGetters);

            /*
             * Forecast for days or year
             */
            var tempsForDaysOfYear =
                TemperatureData.TemperaturesForYear(tileId, dateTicks);
            var temperaturesForDaysOfYearGetters = new List <ColumnData <TemperatureForecastForYear> >
            {
                new ColumnData <TemperatureForecastForYear>("PLTFW_Day".Translate(), "PLTFW_DayToolTip".Translate(), tffy => $"{tffy.Day}"),
                new ColumnData <TemperatureForecastForYear>("PLTFW_Min".Translate(), "PLTFW_MinToolTip".Translate(),
                                                            tffy => $"{tffy.MinTemp:F2}"),
                new ColumnData <TemperatureForecastForYear>("PLTFW_Max".Translate(), "PLTFW_MaxToolTip".Translate(),
                                                            tffy => $"{tffy.MaxTemp:F2}"),
                new ColumnData <TemperatureForecastForYear>("PLTFW_OffSeason".Translate(), "PLTFW_OffSeasonToolTip".Translate(),
                                                            tffy => $"{tffy.OffsetFromSeasonCycle:F2}"),
                new ColumnData <TemperatureForecastForYear>("PLTFW_OffDRV".Translate(), "PLTFW_OffDRVToolTip".Translate(),
                                                            tffy => $"{tffy.OffsetFromDailyRandomVariation:F2}")
            };
            var tableViewTempForYear =
                new TableView <TemperatureForecastForYear>("PLTFW_ForecastForNextYear".Translate(), tempsForDaysOfYear,
                                                           temperaturesForDaysOfYearGetters);

            /*
             * Window and views
             */
            var temperatureWindow = new TableWindow(tileId, dateTicks, 0.33f);

            temperatureWindow.ClearTables();
            temperatureWindow.AddTable(tableViewTempForDay);
            temperatureWindow.AddTable(tableViewTempForTwelves);
            temperatureWindow.AddTable(tableViewTempForYear);

            Find.WindowStack.Add(temperatureWindow);
        }
        public void ShowTable(string aTableName, bool Messages = false)
        {
            if (aTableName == null)
            {
                if (Messages) MessageBox.Show("Please pass a table name", "Show Table");
                return;
            }

            ITable myTable = GetTable(aTableName);
            if (myTable == null)
            {
                if (Messages)
                {
                    MessageBox.Show("Table " + aTableName + " not found in map");
                    return;
                }
            }

            ITableWindow myWin = new TableWindow();
            myWin.Table = myTable;
            myWin.Application = thisApplication;
            myWin.Show(true);
        }
 private void IntervalSearch_Click(object sender, RoutedEventArgs e)
 {
     init_intvscell();
     TableWindow tblWindow = new TableWindow(intvscell, classification: false);
     tblWindow.Show();
 }
示例#10
0
        public override string GetDesignTimeHtml()
        {
            string initMessage = string.Empty;

            System.Text.StringBuilder s = new System.Text.StringBuilder();

            TableWindow component = (TableWindow)base.Component;

//			initMessage = component.__designInit();

            s.Append("<table id=\"" + component.ClientID + "\"");
            if (component.CssClass != "")
            {
                s.Append(" class=\"" + component.CssClass + "\"");
            }
            if (!component.CellPadding.IsEmpty)
            {
                s.Append(" cellPadding=\"" + component.CellPadding.ToString() + "\"");
            }
            if (!component.CellSpacing.IsEmpty)
            {
                s.Append(" cellSpacing=\"" + component.CellSpacing.ToString() + "\"");
            }
            if (!component.BorderWidth.IsEmpty)
            {
                s.Append(" border=\"" + component.BorderWidth.ToString() + "\"");
            }
            if (!component.Width.IsEmpty)
            {
                s.Append(" width=\"" + component.Width.ToString() + "\"");
            }
            if (!component.Height.IsEmpty)
            {
                s.Append(" height=\"200px\"");
                s.Append(" style=\"height:200px;\"");

//				s.Append(" height=\"" + component.Height.ToString() + "\"");
//				s.Append(" style=\"height:" + component.Height.ToString() + ";\"");
            }
            s.Append(">");

            // Title

            s.Append("<tr><th");
            if (component.ColumnCount != 1)
            {
                s.Append(" colspan=\"" + component.ColumnCount + "\"");
            }
            if (component.HeaderCssClass != string.Empty)
            {
                s.Append(" class=\"" + component.HeaderCssClass + "\"");
            }
            s.Append(">");
            s.Append(component.Text + " (" + component.ID + ")");
            s.Append("</th></tr>");

            // Toolbar

            if (component.ComponentCheck(TableWindowComponents.Toolbar))
            {
                s.Append("<tr>");
                s.Append("<td ");
                if (component.ColumnCount != 1)
                {
                    s.Append(" colspan=\"" + component.ColumnCount + "\"");
                }
                if (component.SubHeaderCssClass != string.Empty)
                {
                    s.Append(" class=\"" + component.SubHeaderCssClass + "\"");
                }
                s.Append(" height=\"28px\"");
                s.Append(">");
                s.Append("Toolbar");
                s.Append("</td></tr>");
            }

            // Content

//			if(component.ComponentCheck(TableWindowComponents.ContentHeader))
//			{
//				s.Append("<tr>");
//				s.Append("<td ");
//				if(component.ColumnCount != 1)
//					s.Append(" colspan=\"" + component.ColumnCount + "\"");
//				if(component.ContentCssClass != string.Empty)
//					s.Append(" class=\"" + component.ContentCssClass + "\"");
//				s.Append(" valign=\"top\"");
//				s.Append(" height=\"100%\"");
//				s.Append(" width=\"100%\"");
//				s.Append(">");
//				s.Append("Content Header");
//				s.Append("</td></tr>");
//			}

            s.Append("<tr>");
            s.Append("<td ");
            if (component.ColumnCount != 1)
            {
                s.Append(" colspan=\"" + component.ColumnCount + "\"");
            }
            if (component.ContentCssClass != string.Empty)
            {
                s.Append(" class=\"" + component.ContentCssClass + "\"");
            }
            s.Append(" valign=\"top\"");
            s.Append(" height=\"100%\"");
            s.Append(" width=\"100%\"");
            s.Append(">");

            s.Append("<div");
            s.Append(" id=" + component.ID + "_ContentDiv");
            s.Append(" style=\"");
            if (component.ComponentCheck(TableWindowComponents.ViewPane))
            {
                s.Append("float:left;visibility:visible;");
                s.Append("width:" + component.ContentWidth.ToString() + ";");
            }
            else
            {
                s.Append(" width:100%;");
            }
            if (component.FeatureCheck(TableWindowFeatures.Scroller))
            {
                s.Append("overflow:scroll;");
            }
            s.Append("height:100%;");
            s.Append("\"");
            if (component.ContentCssClass != string.Empty)
            {
                s.Append(" class=\"" + component.ContentCssClass + "\"");
            }
            s.Append(">");

            // Fake Table
            s.Append("<table id=\"" + component.ClientID + "_datatable\"");
            s.Append(" cellpadding=\"" + component.CellPadding.ToString() + "\"");
            s.Append(" cellspacing=\"" + component.CellSpacing.ToString() + "\"");
            s.Append(" class=\"" + component.ContentCssClass.ToString() + "\"");
            s.Append(" width=\"100%\"");
            s.Append(">");

            if (component is TableGrid)
            {
                TableGrid g = (TableGrid)component;
                s.Append("<tr><td class=\"" + g.HeaderRowCssClass + "\">Item</td>" +
                         "<td class=\"" + g.HeaderRowCssClass + "\">Quantity</td></tr>");
                s.Append("<tr><td class=\"" + g.SelectedRowCssClass + "\">Object One</td>" +
                         "<td class=\"" + g.SelectedRowCssClass + "\">34</td></tr>");
                s.Append("<tr><td class=\"" + g.DefaultRowCssClass + "\">Object Two</td>" +
                         "<td class=\"" + g.DefaultRowCssClass + "\">17</td></tr>");
                s.Append("<tr><td class=\"" + g.AlternateRowCssClass + "\">Object Three</td>" +
                         "<td class=\"" + g.AlternateRowCssClass + "\">22</td></tr>");
            }
            else
            {
                s.Append("<tr><td>Item 1</td></tr>");
                s.Append("<tr><td>Item 2</td></tr>");
                s.Append("<tr><td>Item 3</td></tr>");
                s.Append("<tr><td>Item 4</td></tr>");
            }

            s.Append("</table>");

            s.Append("</div>");

            // Viewpane Div
            if (component.ComponentCheck(TableWindowComponents.ViewPane))
            {
                s.Append("<div id=\"__gfxViewPane_" + component.ID + "\"");
                s.Append(" style=\"overflow:scroll;visibility:visible;width=100%;height=100%;\"");
                s.Append(">");
                if (initMessage != string.Empty)
                {
                    s.Append(initMessage);
                }
                else
                {
                    s.Append("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras eget eros. " +
                             "Etiam vel ante. Donec vehicula.");
                }
                s.Append("</div>");
            }

            s.Append("</td></tr>");

//			if(component.ComponentCheck(TableWindowComponents.Footer))
//			{
//				s.Append("<tr>");
//				s.Append("<td ");
//				if(component.ColumnCount != 1)
//					s.Append(" colspan=\"" + component.ColumnCount + "\"");
//				if(component.ContentCssClass != string.Empty)
//					s.Append(" class=\"" + component.ContentCssClass + "\"");
//				s.Append(" valign=\"top\"");
//				s.Append(" height=\"100%\"");
//				s.Append(" width=\"100%\"");
//				s.Append(">");
//				s.Append("Footer");
//				s.Append("</td></tr>");
//			}

            // End Table

            s.Append("</table>");

            return(s.ToString());
        }
        /// <summary>
        /// 初始化餐桌定位页面
        /// </summary>
        public void InitTableLocation(){
            TableXaml = new TableWindow();
            Config config = _ConfigurationService.Find(TableLocationMapping.TableLocationName[TableLocation.NAME]);
            if (config != null)
            {

                string[] value=config.Value.Split(new char[]{'_'});
                //餐桌定位的拼接类型是编码或者id直接使用下划线分割"_"
                if (config.Disabled == 1)   //餐桌类型
                {
                    TableXaml.TableType.IsChecked = true;
                    LoaderTableTypeLocation(value);
                }
                else if (config.Disabled == 2)   //区域
                {
                    TableXaml.Location.IsChecked = true;
                    LoaderTableLocation(value);
                }
            }
            TableXaml.ShowDialog();
        }
示例#12
0
        public List <string> parser(string Path, TableWindow window)
        {
            StreamReader Reader    = new StreamReader(Path);
            string       File_data = Reader.ReadToEnd();

            Reader.Close();
            string[]      Temp       = File_data.Split(new char[] { ' ', '\r', '\n', ';' });
            StreamWriter  FileWriter = new StreamWriter(window.TextParser);
            List <string> File_List  = Temp.ToList <string>();

            for (int i = File_List.Count - 1; i > 0; i--)
            {
                if ((File_List[i] == "") || (File_List[i] == ";"))
                {
                    File_List.RemoveAt(i);
                }
            }
            int len = File_List.Count;

            for (int i = 0; i < File_List.Count; i++)
            {
                if (i + 1 < File_List.Count)
                {
                    if (File_List[i + 1].Contains("."))
                    {
                        if (i + 2 < File_List.Count)
                        {
                            if (File_List[i + 2].Contains("(Отв.)"))
                            {
                                window.NameSet.Add(File_List[i] + " " + File_List[i + 1]);
                                File_List[i] = File_List[i] + " " + File_List[i + 1] + " " + File_List[i + 2];
                                File_List.RemoveAt(i + 1);
                                File_List.RemoveAt(i + 1);
                            }
                            else
                            {
                                window.NameSet.Add(File_List[i] + " " + File_List[i + 1]);
                                File_List[i] = File_List[i] + " " + File_List[i + 1];
                                File_List.RemoveAt(i + 1);
                                File_List[i].Replace(";", "");
                            }
                        }
                    }
                    else
                    {
                        if (i + 3 < File_List.Count)
                        {
                            if (File_List[i + 3].Contains("(Отв.)"))
                            {
                                window.NameSet.Add(File_List[i] + " " + File_List[i + 1][0] + "." + File_List[i + 2][0] + ".");
                                File_List[i] = File_List[i] + " " + File_List[i + 1][0] + "." + File_List[i + 2][0] + ". " + File_List[i + 3];
                                File_List.RemoveAt(i + 1);
                                File_List.RemoveAt(i + 1);
                                File_List.RemoveAt(i + 1);
                            }
                            else
                            {
                                window.NameSet.Add(File_List[i] + " " + File_List[i + 1][0] + "." + File_List[i + 2][0] + ".");
                                File_List[i] = File_List[i] + " " + File_List[i + 1][0] + "." + File_List[i + 2][0] + ".";
                                File_List.RemoveAt(i + 1);
                                File_List.RemoveAt(i + 1);
                            }
                        }
                    }
                }
            }
            //Проверка последних элементов на особые случаи
            if ((File_List[File_List.Count - 1].Contains('.')) && (File_List[File_List.Count - 1].Length == 4))
            {
                window.NameSet.Add(File_List[File_List.Count - 2] + " " + File_List[File_List.Count - 1]);
                File_List[File_List.Count - 2] += " " + File_List[File_List.Count - 1];
                File_List.RemoveAt(File_List.Count - 1);
            }

            foreach (string item in File_List)
            {
                FileWriter.WriteLine(item);
            }
            FileWriter.Close();

            return(File_List);
        }