【XAMLでやるとき】
【C#でやるとき】
Binding db = new Binding();
db.ElementName = "Slider1";
db.Path = new PropertyPath("Value");
this.TextBox1.SetBinding(TextBox.TextProperty, db);
Binding db = new Binding();
db.ElementName = "Slider1";
db.Path = new PropertyPath("Value");
this.TextBox1.SetBinding(TextBox.TextProperty, db);
BitmapImage bi= new BitmapImage(new Uri("C:\test.jpg"));
this.ImageArea.Source = bi;
BitmapSource SourceData = (BitmapSource)this.ImageArea.Source;
this.ImageArea.Width = SourceData.PixelWidth;
this.ImageArea.Height= SourceData.PixelHeight;
private FileInfo[] GetFiles
{
FileInfo[] fis;
//・・・(略)
Array.Sort(fis, delegate(FileInfo x, FileInfo y) { return x.LastWriteTime.CompareTo(y.LastWriteTime); });
}
Array.Sort(
fis
,
delegate(FileInfo x, FileInfo y)
{
return x.LastWriteTime.CompareTo(y.LastWriteTime);
}
);
private static void GetImageFromWebMain(){}
public delegate void GetImageFromWebDelegate();
public static GetImageFromWebDelegate getImageFromWebDelegate;
private static void GetImageFromWebCallBack(IAsyncResult ar){}
getImageFromWebDelegate = new GetImageFromWebDelegate(GetImageFromWebMain);
getImageFromWebDelegate.BeginInvoke(new AsyncCallback(GetImageFromWebCallBack), null);
Response.Buffer = true;
Response.ContentType = "image/gif";
int[] aX = new int[10];
int[] aY = new int[10];
Random r = new Random();
ChartSpace cs = new ChartSpace();
ChChart chc = cs.Charts.Add(0);
ChSeries chs = chc.SeriesCollection.Add(0);
chs.Type = ChartChartTypeEnum.chChartTypeScatterLineMarkers;
chs.SetData( ChartDimensionsEnum.chDimSeriesNames
, (int)ChartSpecialDataSourcesEnum.chDataLiteral, "Chart1_Series1");
chs.SetData(ChartDimensionsEnum.chDimXValues
, (int)ChartSpecialDataSourcesEnum.chDataLiteral, aX);
chs.SetData(ChartDimensionsEnum.chDimYValues
, (int)ChartSpecialDataSourcesEnum.chDataLiteral, aY);
chc.HasLegend = true;
chc.Legend.Position = ChartLegendPositionEnum.chLegendPositionBottom;
chc.HasTitle = true;
chc.Title.Caption = "Chart1";
chc.Axes[0].HasTitle = true;
chc.Axes[0].Caption = "Y axis";
chc.Axes[1].HasTitle = true;
chc.Axes[1].Caption = "X axis";
Response.BinaryWrite((byte[])cs.GetPicture("gif", 500, 400));
Response.End();
//Excelのダウンロード
SpreadsheetClass xlsheet = new SpreadsheetClass();
// ダミーデータ
for(int i = 1 ; i< 11 ; i++)
{
xlsheet.ActiveSheet.Cells[i, i] = i.ToString();
}
String xlFileName = System.DateTime.Now.Ticks.ToString() + ".xls";
xlsheet.Export(Server.MapPath(".") + "\\" + xlFileName
, SheetExportActionEnum.ssExportActionNone
, SheetExportFormat.ssExportHTML);
Response.ContentType = "application/x-msexcel";
Response.WriteFile(Server.MapPath(".") + "\\" + xlFileName);