This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function GetEncoder() { | |
| $format = [Drawing.Imaging.ImageFormat]::Jpeg | |
| $codecs = [System.Drawing.Imaging.ImageCodecInfo]::GetImageDecoders() | |
| foreach ($codec in $codecs) { | |
| if ($codec.FormatID -eq $format.Guid) { | |
| return $codec; | |
| } | |
| } | |
| return $null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Microsoft.Graph; | |
| using Microsoft.Graph.Auth; | |
| using Microsoft.Identity.Client; | |
| namespace teamsautomation | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import './App.css'; | |
| import { PrimaryButton, Checkbox } from 'office-ui-fabric-react'; | |
| import { stat } from 'fs'; | |
| interface IQuestion { | |
| title: string, | |
| options: string[], | |
| answer: string[] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 第一个文件 | |
| import React from 'react' | |
| interface MyContext { | |
| language: string | |
| } | |
| export const languageContext = React.createContext<MyContext>({ | |
| language: "en-US" | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; | |
| import { Action, createStore } from 'redux'; | |
| import { Provider, ReactReduxContext } from 'react-redux'; | |
| const reducer = (state = 0, action: Action) => { | |
| switch (action.type) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 这是一个完整的React例子,用来根据用户输入查找Github用户数据,并且添加到一个集合中进行展示 | |
| */ | |
| import React, { useState, FormEvent } from 'react'; | |
| //用户配置文件的接口定义 | |
| interface UserProfile { | |
| key: number, | |
| photo: string, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState } from 'react'; | |
| //定义组件属性的接口(用来实现强类型) | |
| interface ButtonProps { | |
| increment: number, | |
| onClickFunction: React.Dispatch<number> | |
| } | |
| interface DisplayProps { | |
| message: number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Microsoft.Identity.Client; | |
| using Microsoft.Graph; | |
| using System.Net.Http.Headers; | |
| using System.Threading.Tasks; | |
| namespace graphserviceapp | |
| { | |
| class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Microsoft.Identity.Client; | |
| using Microsoft.Graph; | |
| using System.Net.Http.Headers; | |
| using System.Threading.Tasks; | |
| namespace graphserviceapp | |
| { | |
| class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| using Microsoft.Graph; | |
| using Microsoft.Identity.Client; | |
| namespace testconsole | |
| { | |
| class GraphAuthenticator : IAuthenticationProvider |