public DrawingView(InfoList infoList)
 {
     //
     this.infoList = infoList;
     InitializeComponent();
     this.Paint += DrawingView_Paint;
 }
Exemple #2
0
 public void Remove(string assetFullName)
 {
     Init();
     InfoList.RemoveAt(NameList.IndexOf(assetFullName));
     NameList.Remove(assetFullName);
     EditorUtility.SetDirty(this);
 }
    public LoadingTipsInfo Lookup(int id)
    {
        LoadingTipsInfo info;

        InfoList.TryGetValue(id, out info);
        return(info);
    }
        /// <summary>
        /// Instanciates and fills a new information list.
        /// </summary>
        /// <param name="prefix">The prefix.</param>
        /// <param name="data">The data, either as InfoList.InfoData, or in pairs of name, data.</param>
        /// <returns>
        /// A new information list.
        /// </returns>
        public static InfoList List(string prefix, params object[] data)
        {
            InfoList info = new InfoList(prefix);

            object[] objects;
            if (data.Length == 1 && data[0] is object[] && (data[0] as object[]).Length > 0)
            {
                objects = data[0] as object[];
            }
            else
            {
                objects = data;
            }

            for (int i = 0; i < objects.Length; i++)
            {
                if (objects[i] is InfoList.InfoData)
                {
                    info.Add((InfoList.InfoData)objects[i]);
                }
                else if (i == objects.Length - 1)
                {
                    info.Add(null, objects[i]);
                }
                else
                {
                    info.Add(ObjectToString(objects[i]), objects[i + 1]);
                    i++;
                }
            }

            return(info);
        }
Exemple #5
0
 public void Add(string assetFullName, AssetInfo asset)
 {
     Init();
     NameList.Add(assetFullName);
     InfoList.Add(asset);
     EditorUtility.SetDirty(this);
 }
Exemple #6
0
 private void SelectAll_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < InfoList.Items.Count; i++)
     {
         InfoList.SetItemChecked(i, true);
     }
 }
Exemple #7
0
 public void AddInfo(string message)
 {
     InfoList.Add(new Info
     {
         Message = message
     });
 }
Exemple #8
0
        private bool RefreshAndSave()
        {
            if (refreshAlternating)
            {
                System.Diagnostics.Debug.WriteLine("RefreshAndSave");

                Task.Run(async() => {
                    //foreach (User u in App.Users) { await HttpRequests.PostUserEdit(u); }
                    await HttpRequests.extaractUsers();
                }).ContinueWith((end) => {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        if (SearchBar.Text != "" && SearchBar.Text != null)
                        {
                            InfoList.ItemsSource = App.Users.AsEnumerable().Where(i => i.name.ToLower().Contains(SearchBar.Text.ToLower()));
                        }
                        else
                        {
                            InfoList.ItemsSource = App.Users;
                        }

                        InfoList.EndRefresh();
                    });
                });
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Save");

                //Task.Run(async () => { foreach (User u in App.Users) { await HttpRequests.PostUserEdit(u); } });
            }

            refreshAlternating = !refreshAlternating;
            return(App.Foreground);
        }
Exemple #9
0
 public void Clear()
 {
     NameList.Clear();
     InfoList.Clear();
     EditorUtility.SetDirty(this);
     AssetDatabase.SaveAssets();
 }
Exemple #10
0
 public AppFileManager()
 {
     _AppFiles = new InfoList <AppFileInfo>();
     System.Threading.ThreadPool.QueueUserWorkItem((state) =>
     {
         Enterprises = ServiceHelper.GetAllEnterprises();
     });
 }
Exemple #11
0
 private void RadioButton_Click_1(object sender, RoutedEventArgs e)
 {
     if (V_infoList == null)
     {
         V_infoList = new InfoList();
     }
     DataContext = V_infoList;
 }
Exemple #12
0
        public TextView(InfoList infoList)
        {
            //
            this.infoList = infoList;
            InitializeComponent();

            UpdateInfo();
        }
 public void AddInfo(InfoType type, string msg)
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         var item = new InfoLine(type, msg);
         InfoList.Items.Add(item);
         InfoList.ScrollIntoView(item);
     });
 }
Exemple #14
0
 public ExecutionResult AddInfo(string intel)
 {
     if (InfoList == null)
     {
         InfoList = new List <string>();
     }
     InfoList.Add(intel);
     return(this);
 }
        public void FormatResult_Returns_InternalSearchResult()
        {
            // Arrange.
            const string ProcessDisplayName = "Test Process";
            const int TotalRowCount = 123;
            const int PageNumber = 3;

            var items = new InfoList<IInfoClass>
                            {
                                new InfoItem { Field1 = "Value 1.1", Field2 = "Value 1.2", Field3 = "Value 1.3" },
                                new InfoItem { Field1 = "Value 2.1", Field2 = "Value 2.2", Field3 = "Value 2.3" }
                            };
            items.TotalRowCount = TotalRowCount;
            items.PageNumber = PageNumber;

            var filters = new List<Filter> { new Filter(), new Filter() };
            var layouts = new List<LayoutMetadata> { new LayoutMetadata(), new LayoutMetadata() };
            var relatedProcesses = new List<ProcessMetadata> { new ProcessMetadata(), new ProcessMetadata() };
            var appliedFilter = new Filter();
            var appliedLayout = new LayoutMetadata();

            var searchResult = new SearchCommandResult
                                   {
                                       ProcessDisplayName = ProcessDisplayName,
                                       AppliedFilter = appliedFilter,
                                       FilterParametersRequired = false,
                                       AppliedLayout = appliedLayout,
                                       Items = items,
                                       ResultColumns = { CreateColumnMetadata("Field1"), CreateColumnMetadata("Field3") },
                                       Filters = filters,
                                       Layouts = layouts,
                                       RelatedProcesses = relatedProcesses
                                   };

            var formatter = new InternalSearchResultFormatter(_colorTranslator);

            // Act.
            var result = formatter.FormatResult(searchResult);

            // Assert.
            Assert.IsNotNull(result);
            Assert.AreEqual(ProcessDisplayName, result.ProcessDisplayName);
            Assert.AreSame(appliedFilter, result.AppliedFilter);
            Assert.IsFalse(result.FilterParametersRequired);
            Assert.AreSame(appliedLayout, result.AppliedLayout);
            Assert.AreEqual(PageNumber, result.CurrentPage);
            Assert.AreEqual(TotalRowCount, result.TotalRowCount);
            Assert.IsTrue(result.Filters.SequenceEqual(filters));
            Assert.IsTrue(result.Layouts.SequenceEqual(layouts));
            Assert.IsTrue(result.RelatedProcesses.SequenceEqual(relatedProcesses));

            Assert.IsNotNull(result.Items);
            Assert.AreEqual(2, result.Items.Count);
            Assert.IsTrue(result.Items[0].Values.SequenceEqual(new[] { "Value 1.1", "Value 1.3" }));
            Assert.IsTrue(result.Items[1].Values.SequenceEqual(new[] { "Value 2.1", "Value 2.3" }));
        }
 public IPAInstallerGenerator(IPAInfo[] infos, string outputDir, string baseUrl, string uuidServiceUrl, CustomFileCopyHandler fileCopyHandler) :
     this()
 {
     InfoList.Clear();
     InfoList.AddRange(infos);
     OutputDir      = outputDir;
     BaseUrl        = baseUrl;
     UUIDServiceUrl = uuidServiceUrl;
     CustomFileCopy = fileCopyHandler;
 }
Exemple #17
0
 private void Serial_DataReceived(object sender, SerialDataReceivedEventArgs e)
 {
     Application.Current.Dispatcher.Invoke(new Action(() =>
     {
         char[] content = new char[serial.BytesToRead];
         serial.Read(content, 0, serial.BytesToRead);
         InfoList.Items.Add(new string(content));
         InfoList.ScrollIntoView(InfoList.Items[InfoList.Items.Count - 1]);
     }));
 }
Exemple #18
0
 public void SetStationList(params StationBase[] stations)
 {
     foreach (var it in stations)
     {
         InfoList.Add(new StationInfoModel()
         {
             StationName = it.StationName,
         });
     }
 }
Exemple #19
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     //SettingModel settingModel = SettingJsonConfig.readJson() ?? new SettingModel();
     //autoPrint.IsChecked = settingModel.AutoPrint;
     UrlModel.autoPrint = true;
     if (V_infoList == null)
     {
         V_infoList = new InfoList();
     }
     DataContext = V_infoList;
     synchronization();
 }
Exemple #20
0
        public void ShowInfo(string msg, StationBase station, int maxCount = 5)
        {
            var modellist = InfoList.Where(m => m.StationName.Equals(station.StationName)).First();

            if (modellist != null)
            {
                modellist.InfoCollect.Add(msg);
                while (modellist.InfoCollect.Count > maxCount)
                {
                    modellist.InfoCollect.RemoveAt(0);
                }
            }
        }
Exemple #21
0
 private void ReverseSelect_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < InfoList.Items.Count; i++)
     {
         if (InfoList.GetItemChecked(i))
         {
             InfoList.SetItemChecked(i, false);
         }
         else
         {
             InfoList.SetItemChecked(i, true);
         }
     }
 }
Exemple #22
0
 public void Add(GraphAsset graphAsset, string name, ActionStateContainer container, int index)
 {
     if (Map.TryGetValue(graphAsset, out var list) == false)
     {
         list = new InfoList();
         Map.Add(graphAsset, list);
     }
     list.Version++;
     list.Infos.Add(new Info()
     {
         Name      = (name == string.Empty)?"Entity":name,
         container = container,
         Index     = index
     });
 }
    public void bind()
    {
        long   CurrPage   = 0;
        long   TotalCount = 0;
        string strWhere   = " ReportMan=''";

        if (Request.QueryString["InfoID"] != null)
        {
            strWhere = "  InfoID='" + Request.QueryString["InfoID"].ToString() + "'";
        }
        DataTable dt = dal.GetList("InfoReportViw", "ID", "*", strWhere, "ID desc", ref CurrPage, 15, ref TotalCount);

        InfoList.DataSource = dt;
        InfoList.DataBind();
    }
        public IActionResult CreateTablos()
        {
            var info = new InfoList();
            List <InfoModel> models = info.addList();

            if (models == null)
            {
                return(BadRequest("false"));
            }

            for (int i = 0; i < models.Count; i++)
            {
                _service.AddUserAndPace(models[i].id, models[i].username, models[i].age, models[i].total_time, models[i].distance);
            }
            return(Ok("true"));
        }
        public MainPage()
        {
            this.InitializeComponent();
            var info  = MainInfo.GetInfo();
            var infos = MainInfo.GetInfos();
            //TruckID.Text = info.ID;
            //TruckName.Text = info.Name;
            //TruckStyle.Text = info.Style;

            var data = new InfoList()
            {
                Infos = new ObservableCollection <Info.TruckInfo>(infos.Infos)
            };

            //DataContext = data;
            Data = data;
        }
Exemple #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //绑定工作计划
                Repeater1.DataSource = WebBLL.Tbl_InfoManager.GetDataTableByPage(5, 1, "(classid='院级工作' or classid='部门工作')", "id desc");
                Repeater1.DataBind();

                //绑定内部消息
                InfoList.DataSource = WebBLL.Tbl_MessageManager.GetDataTableByPage(5, 1, "UserNameTo like '%" + WebCommon.Public.GetUserName() + "%'", "");
                InfoList.DataBind();

                //绑定新闻公告
                InfoList2.DataSource = WebBLL.Tbl_InfoManager.GetDataTableByPage(5, 1, "(classid<>'院级工作' and classid<>'部门工作' and status='已审核')", "AddDate desc");
                InfoList2.DataBind();
            }
        }
    //save picture and upload
    public void OnClick4()
    {
        byte[] bytes = texture.EncodeToPNG();

        //save to local directory
        //File.WriteAllBytes(Application.dataPath + "/../SavedScreen.png", bytes);

        string shopID      = "02";
        string shopName    = "麥當勞";
        string shopAddress = "公園北路3號";
        string telephone   = "091234";
        Gps    gps         = new Gps("12.3", "2.4");

        List <TimePeriod> timePeriod = new List <TimePeriod>();

        timePeriod.Add(new TimePeriod("10", "30", "15", "00"));
        List <Item> item = new List <Item>();

        item.Add(new Item(true, timePeriod));
        OpenTime openTime = new OpenTime(item);

        List <Item2> item2 = new List <Item2>();

        item2.Add(new Item2("哈哈", "笑你"));
        InfoList infoList = new InfoList(item2);

        List <Item4> item4 = new List <Item4>();

        item4.Add(new Item4(bytes, "png"));
        Picture1 picture = new Picture1(item4);

        WWWForm formData = new WWWForm();

        formData.AddField("shopID", shopID);
        formData.AddField("shopName", shopName);
        formData.AddField("shopAddress", shopAddress);
        formData.AddField("telephone", telephone);
        formData.AddField("gps", JsonUtility.ToJson(gps));
        formData.AddField("openTime", JsonUtility.ToJson(openTime));
        formData.AddField("infoList", JsonUtility.ToJson(infoList));
        formData.AddField("picture", JsonUtility.ToJson(picture));

        StartCoroutine(Upload(formData));
    }
Exemple #28
0
        private static List <InfoList> GetInfoListFromDB(string procname, string eids, int pageindex, int pagesize, out int pagecount)
        {
            SqlParameter[] parameters = { new SqlParameter("@pageIndex", SqlDbType.Int), new SqlParameter("@pageSize", SqlDbType.Int), new SqlParameter("@pageCount", SqlDbType.Int), new SqlParameter("@Temp_Array", SqlDbType.VarChar) };
            parameters[0].Value     = pageindex;
            parameters[1].Value     = pagesize;
            parameters[2].Direction = ParameterDirection.Output;
            parameters[3].Value     = eids;
            DataTable dt = SQLHelper.ProcDataTable(procname, parameters);

            pagecount = Convert.ToInt32(parameters[2].Value);
            List <InfoList>      data    = new List <InfoList>();
            DataColumnCollection columns = dt.Columns;

            foreach (DataRow row in dt.Rows)
            {
                InfoList info = new InfoList();
                info = info.DBDataToInfo(row, columns);
                data.Add(info);
            }
            return(data);
        }
        private bool Refresh()
        {
            System.Diagnostics.Debug.WriteLine("Refresh");

            Task.Run(async() => await JsonRequests.getUsers())
            .ContinueWith((end) => {
                Device.BeginInvokeOnMainThread(() =>
                {
                    if (SearchBar.Text != "" && SearchBar.Text != null)
                    {
                        InfoList.ItemsSource = getItems().AsEnumerable().Where(i => i.name.ToLower().Contains(SearchBar.Text.ToLower()));
                    }
                    else
                    {
                        InfoList.ItemsSource = getItems();
                    }

                    InfoList.EndRefresh();
                });
            });
            return(App.Foreground);
        }
Exemple #30
0
 private void GetResults()
 {
     if (!string.IsNullOrEmpty(_queryInput) && !string.IsNullOrWhiteSpace(_queryInput))
     {
         InfoList.Clear();
         var query   = new Query();
         var results = query.GetSearchResult(_queryInput, _selectedEngine);
         if (results != null && results.Any())
         {
             foreach (var r in results)
             {
                 var model = new DisplayModel()
                 {
                     RelatedKey  = r.RelatedKey,
                     Description = r.Description,
                     Url         = r.Url,
                 };
                 InfoList.Add(model);
             }
             NotifyPropertyChanged("InfoList");
             SelectedInfo = InfoList.FirstOrDefault();
         }
     }
 }
Exemple #31
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        LevelEditor manager = (LevelEditor)target;

        GridType[] types = new GridType[] { GridType.Radial, GridType.Square };

        if (Application.isPlaying)
        {
            if (CanSave(manager))
            {
                gridSaving = EditorGUILayout.BeginFoldoutHeaderGroup(gridSaving, "Grid Saving");
                if (gridSaving)
                {
                    manager.savefileName = EditorGUILayout.TextField("Save File Name", manager.savefileName);
                    if (GUILayout.Button("Save"))
                    {
                        manager.SaveGrid();
                    }
                }
                EditorGUILayout.EndFoldoutHeaderGroup();
            }
            else if (manager.LoadableFiles != null && manager.LoadableFiles.Count > 0)
            {
                gridLoading = EditorGUILayout.BeginFoldoutHeaderGroup(gridLoading, "Grid Loading");
                if (gridLoading)
                {
                    int index = manager.LoadableFiles.IndexOf(manager.loadFileName);
                    manager.SetLoadFile(EditorGUILayout.Popup(index, manager.LoadableFiles.ToArray()));
                    if (GUILayout.Button("Load"))
                    {
                        manager.LoadGrid();
                    }
                }
                EditorGUILayout.EndFoldoutHeaderGroup();
            }

            circuitCreator = EditorGUILayout.BeginFoldoutHeaderGroup(circuitCreator, "Circuit Creator");
            if (circuitCreator)
            {
                circuitName       = EditorGUILayout.TextField("Circuit Name", circuitName);
                circuitDifficulty = (Difficulty)EditorGUILayout.EnumPopup("Difficulty", circuitDifficulty);
                circuitTier       = (CircuitTier)EditorGUILayout.EnumPopup("Circuit Teir", circuitTier);
                finalCircuit      = EditorGUILayout.Toggle("Final Circuit", finalCircuit);

                for (int i = circuitLevels.Count - 1; i > -1; i--)
                {
                    if (GUILayout.Button("Remove " + circuitLevels[i]))
                    {
                        circuitLevels.RemoveAt(i);
                    }
                }

                GUILayout.Space(20);
                if (manager.currentGridFile != null && circuitLevels.Count < 7 && !circuitLevels.Contains(manager.currentGridFile))
                {
                    if (GUILayout.Button("Add Current Grid"))
                    {
                        circuitLevels.Add(manager.currentGridFile);
                    }
                }
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            newspaperInfo = EditorGUILayout.BeginFoldoutHeaderGroup(newspaperInfo, "NewspaperInfo");
            if (newspaperInfo)
            {
                date         = EditorGUILayout.TextField("Date", date);
                headline     = EditorGUILayout.TextField("Headline", headline);
                articleTitle = EditorGUILayout.TextField("Article Title", articleTitle);
                EditorGUILayout.LabelField("Article Description");
                articleDescription = EditorGUILayout.TextArea(articleDescription, GUILayout.Height(60));
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            postCircuitStory = EditorGUILayout.BeginFoldoutHeaderGroup(postCircuitStory, "Post Circuit Story");
            if (postCircuitStory)
            {
                hasStoryScene = GUILayout.Toggle(hasStoryScene, "Has Story");
                storyHeader   = EditorGUILayout.TextField("Story Header", storyHeader);
                GUILayout.Label("Story Scene Description");
                storyDescription = EditorGUILayout.TextArea(storyDescription, GUILayout.Height(60));
            }
            EditorGUILayout.EndFoldoutHeaderGroup();

            if (loadableCircuits.Count > 0)
            {
                circuitLoading = EditorGUILayout.BeginFoldoutHeaderGroup(circuitLoading, "Circuit Loading");
                if (circuitLoading)
                {
                    circuitIndex = EditorGUILayout.Popup(circuitIndex, loadableCircuits.ToArray());
                    if (GUILayout.Button("Load"))
                    {
                        Circuit circuit = JsonSaveLoad.LoadFile <Circuit>(FolderPath.Circuits, loadableCircuits[circuitIndex]);
                        InfoList <NewspaperInfo> newsList = JsonSaveLoad.LoadResource <InfoList <NewspaperInfo> >("Newspaper");

                        circuitFileName   = loadableCircuits[circuitIndex];
                        circuitName       = circuit.name;
                        circuitDifficulty = circuit.difficulty;
                        circuitTier       = circuit.circuitTier;
                        finalCircuit      = circuit.IsFinalCircuit();
                        circuitLevels.Clear();
                        circuitLevels.AddRange(circuit.grids);

                        bool missingNewspaper = true;
                        if (newsList != default(InfoList <NewspaperInfo>))
                        {
                            NewspaperInfo newsInfo = NewspaperInfo.BinarySearch(newsList.info, circuitName);
                            if (newsInfo != null)
                            {
                                missingNewspaper   = false;
                                date               = newsInfo.date;
                                headline           = newsInfo.headline;
                                articleTitle       = newsInfo.title;
                                articleDescription = newsInfo.description;
                            }
                        }

                        if (missingNewspaper)
                        {
                            date         = "August 8th, 2008";
                            headline     = "Fresh Meat Enters the Circuit Breaker Sport!";
                            articleTitle = "An Actual Challenge";
                            if (circuit.description != null)
                            {
                                articleDescription = circuit.description;
                            }
                            else
                            {
                                articleDescription = "The new challenger will actually have to try in order to overcome this challenge."
                                                     + " I hope they survive... or at least show us a spectacular death!";
                            }
                        }

                        if (circuit.postStoryScene != null && circuit.postStoryScene.Length >= 2)
                        {
                            hasStoryScene    = true;
                            storyHeader      = circuit.postStoryScene[0];
                            storyDescription = circuit.postStoryScene[1];
                        }
                        else
                        {
                            hasStoryScene    = false;
                            storyHeader      = "";
                            storyDescription = "";
                        }
                    }
                }
                EditorGUILayout.EndFoldoutHeaderGroup();
            }

            if (circuitLevels.Count > 0)
            {
                circuitSaving = EditorGUILayout.BeginFoldoutHeaderGroup(circuitSaving, "Circuit Saving");
                if (circuitSaving)
                {
                    circuitFileName = EditorGUILayout.TextField("Circuit File Name", circuitFileName);
                    if (GUILayout.Button("Save Circuit"))
                    {
                        string[] story = null;
                        if (hasStoryScene)
                        {
                            story    = new string[2];
                            story[0] = storyHeader;
                            story[1] = storyDescription;
                        }

                        Circuit circuit   = new Circuit(circuitName, articleDescription, circuitDifficulty, circuitTier, finalCircuit, circuitLevels.ToArray(), story);
                        string  savedName = JsonSaveLoad.SaveFile(FolderPath.Circuits, circuit, circuitFileName, false, true);

                        //Get Newspaper Info and convert it into a list
                        NewspaperInfo            info     = new NewspaperInfo(circuitName, date, headline, articleTitle, articleDescription);
                        InfoList <NewspaperInfo> newsInfo = JsonSaveLoad.LoadResource <InfoList <NewspaperInfo> >("Newspaper");

                        //Add new newspaper info into the list
                        newsInfo.info = NewspaperInfo.BinaryInsert(newsInfo.info, info);

                        //Overwrite previous newspaper list with new data
                        JsonSaveLoad.SaveResource <InfoList <NewspaperInfo> >(newsInfo, "Newspaper");

                        Debug.Log("Saved Circuit as [" + savedName + "]");
                        loadableCircuits = JsonSaveLoad.FindAllFiles(FolderPath.Circuits);
                    }
                }
                EditorGUILayout.EndFoldoutHeaderGroup();
            }
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(manager);
        }
    }