文件墙 CFilewall 记于 2013-09-26
== @[代码] [C#] []WPF] #### 使用了一些公司的组件和放大,但是不多,可以单独抽取出来 --- 程序结构 - Control
- CS
- FileWallItemsControl.cs
- XAML
- FileElementUserControl.xaml
- Images
- Model
- FileModel.cs
- FileModelContainer.cs
- Themes
- Tools
- ConstantClass.cs
- App.xaml
- FileContainers
- FileWallUserControl.xaml
- LoadingUserControl.xaml
- MainWindow.xaml --- ## App.xaml ## > 程序启动文件 ### App.xaml ### 引入资源程序集 ```css
``` ### App.xaml.cs ### ValidatInstance 设置程序为单例 定义整个应用程序需要用到的变量 ```css
namespace CFileWall
{
///
/// App.xaml 的交互逻辑
///
public partial class App : Application
{
Mutex mutex;
public static FileInfo[] Files { get; set; }
public static CFileWall.Model.FileModel[] FileModels { get; set; } protected override void OnStartup(StartupEventArgs e)
{
ValidatInstance();
Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; base.OnStartup(e);
} void ValidatInstance()
{
bool creatednew = false;
mutex = new Mutex(false, "CFileWall", out creatednew);
if (!creatednew)
{
//Application.Current.Shutdown();
App.Current.Shutdown();
return;
} } void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{ e.Handled = true;
}
}
}
``` ## FileWallUserControl.xaml ## ### FileWallUserControl.xaml ### ```css
<FileWall_Control_XAML:FileElementUserControl Width="{Binding Width}" Height="{Binding Height}" Source="{Binding Source}" Type="{Binding Type}">
<Sinnel_Mvvm_Command:InvokeCommandAction Command="{Binding Loaded}" CommandName="Loaded" />
<Micro_Control:SurfaceScrollViewer x:Name="surfaceScrollView" HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Disabled" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling"
Opacity="{Binding ItemsControlOpacity}"
PreviewMouseDown="surfaceScrollView_PreviewMouseDown" PreviewMouseUp="surfaceScrollView_PreviewMouseUp"
PreviewTouchDown="surfaceScrollView_PreviewTouchDown" PreviewTouchUp="surfaceScrollView_PreviewTouchUp">
<FileWall_Control_CS:FileWallItemsControl x:Name="itemsControl_Displayer" HorizontalAlignment="Left" ItemTemplate="{DynamicResource DataTemplate}" ItemsPanel="{DynamicResource ItemsPanelTemplate}"
>
<Micro_Control:ScatterView x:Name="surfaceScatterViewer" >
``` ### FileWallUserControl.xaml.cs ### ```css namespace CFileWall
{
///
/// FileWallUserControl.xaml 的交互逻辑
/// 文件容器
///
public partial class FileWallUserControl : UserControl
{ private Point m_MouseDownPoint = new Point();
private Point m_OldItemCenter = new Point();
private double m_OldItemWidth = 0D;
private double m_OldItemHeight = 0D; #region 依赖项属性 public ObservableCollection FileCollection
{
get { return (ObservableCollection)GetValue(FileCollectionProperty); }
set { SetValue(FileCollectionProperty, value); }
} ///
/// 依赖属性,文件集合
///
public static readonly DependencyProperty FileCollectionProperty =
DependencyProperty.Register("FileCollection", typeof(ObservableCollection), typeof(FileWallUserControl), new UIPropertyMetadata(new ObservableCollection())); ///
/// 控件透明度
///
public double ItemsControlOpacity
{
get { return (double)GetValue(ItemsControlOpacityProperty); }
set { SetValue(ItemsControlOpacityProperty, value); }
} public static readonly DependencyProperty ItemsControlOpacityProperty =
DependencyProperty.Register("ItemsControlOpacity", typeof(double), typeof(FileWallUserControl), new UIPropertyMetadata(1D)); ///
/// 水印图片
///
public string WaterMarkImage
{
get { return (string)GetValue(WaterMarkImageProperty); }
set { SetValue(WaterMarkImageProperty, value); }
} public static readonly DependencyProperty WaterMarkImageProperty =
DependencyProperty.Register("WaterMarkImage", typeof(string), typeof(FileWallUserControl), new UIPropertyMetadata("")); #endregion public FileWallUserControl()
{
InitializeComponent();
this.DataContext = this;
if (App.FileModels != null && App.FileModels.Length > 0)
{
foreach (var item in App.FileModels)
{
string extension = new System.IO.FileInfo(item.FullName).Extension;
if (extension.Equals(".ini"))
{
continue;
} FileModelContainer container = new FileModelContainer(item);
FileCollection.Add(container);
}
itemsControl_Displayer.ItemsSource = FileCollection; Loaded += delegate
{
//string watermarkUri;
//Touco.Shinning.Core.ToolClass.WaterMarkOperations.SetWaterMark(out watermarkUri);
//WaterMarkImage = watermarkUri; };
} } ///
/// 鼠标按下
///
///
///
private void surfaceScrollView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
m_MouseDownPoint = e.GetPosition(this);
} ///
/// 鼠标松开
///
///
///
private void surfaceScrollView_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
Point mouseUpPoint = e.GetPosition(this); if (Math.Abs(mouseUpPoint.X - m_MouseDownPoint.X) < 10 && Math.Abs(mouseUpPoint.Y - m_MouseDownPoint.Y) < 10)
{
VisualTreeHelper.HitTest(sender as Visual, null, new HitTestResultCallback((result) => { if(result.VisualHit.GetType() != typeof(Control.XAML.FileElementUserControl))
{
return HitTestResultBehavior.Continue;
} if(surfaceScatterViewer.Items.Count==0)
{
DisplayItem((result.VisualHit as Control.XAML.FileElementUserControl).DataContext as Model.FileModelContainer);
} return HitTestResultBehavior.Stop;
}), new PointHitTestParameters(e.GetPosition(this)));
} } ///
/// 手指按下
///
///
///
private void surfaceScrollView_PreviewTouchDown(object sender, TouchEventArgs e)
{
m_MouseDownPoint = e.GetTouchPoint(this).Position;
} ///
/// 手指离开
///
///
///
private void surfaceScrollView_PreviewTouchUp(object sender, TouchEventArgs e)
{
Point mouseUpPoint = e.GetTouchPoint(this).Position; if (Math.Abs(mouseUpPoint.X - m_MouseDownPoint.X) < 10 && Math.Abs(m_MouseDownPoint.Y - mouseUpPoint.Y) < 10)
{
VisualTreeHelper.HitTest(sender as Visual, null, new HitTestResultCallback((result) => { if (result.VisualHit.GetType() != typeof(Control.XAML.FileElementUserControl))
{
return HitTestResultBehavior.Continue;
} if (surfaceScatterViewer.Items.Count == 0)
{
DisplayItem((result.VisualHit as Control.XAML.FileElementUserControl).DataContext as FileModelContainer);
} return HitTestResultBehavior.Stop;
}),new PointHitTestParameters(e.GetTouchPoint(this).Position));
} } ///
/// 返回图片鼠标单击或手指离开
///
///
///
private void image_Back_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
App.Current.MainWindow.Close();
} ///
/// 被单独展示的文件的双击事件
///
///
///
void scatterViewItem_DoubleTapped(object sender, RoutedEventArgs e)
{
image_Back.Visibility = System.Windows.Visibility.Visible;
ZoomIn(sender as BaseScatterViewItem);
} #region 公共方法 ///
/// 放大文件
///
///
void ZoomOut(BaseScatterViewItem scatterViewItem)
{
double ratio = scatterViewItem.Width / scatterViewItem.Height; double newWidth, newHeight; if (scatterViewItem.Width / scatterViewItem.Height > (this.ActualWidth) / (this.ActualHeight))
{
newWidth = this.ActualWidth * 0.75;
newHeight = newWidth / ratio;
}
else
{
newHeight = this.ActualHeight * 0.75;
newWidth = newHeight * ratio;
} Point newCenter = new Point(CFileWall.Tools.ConstantClass.SysWidth / 2, CFileWall.Tools.ConstantClass.SysHeight / 2); scatterViewItem.ApplyAnimation(newHeight, newWidth, 0, 1, newCenter, 350, delegate
{
scatterViewItem.Center = newCenter;
scatterViewItem.Opacity = 1;
scatterViewItem.Width = newWidth;
scatterViewItem.Height = newHeight;
scatterViewItem.Orientation = 0;
}); DoubleAnimation opacityAnimation = new DoubleAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(350) };
Storyboard.SetTarget(opacityAnimation, this);
Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath(FileWallUserControl.ItemsControlOpacityProperty));
Storyboard sb = new Storyboard();
sb.Children.Add(opacityAnimation);
sb.Begin(); } ///
/// 缩小文件
///
///
void ZoomIn(BaseScatterViewItem scatterViewItem)
{
scatterViewItem.ApplyAnimation(m_OldItemHeight, m_OldItemWidth, 0, 1, m_OldItemCenter, 350, delegate {
if (scatterViewItem is VideoScatterViewItem)
(scatterViewItem as VideoScatterViewItem).VideoSource = null;
surfaceScatterViewer.Items.Remove(scatterViewItem);
}); DoubleAnimation opacityAnimation = new DoubleAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(350) };
Storyboard.SetTarget(opacityAnimation, this);
Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath(FileWallUserControl.ItemsControlOpacityProperty));
Storyboard sb = new Storyboard();
sb.Children.Add(opacityAnimation);
sb.Begin(); } ///
/// 展示文件
///
///
void DisplayItem(FileModelContainer fmc)
{
BaseScatterViewItem scatterViewItem = BaseScatterViewItem.CreateScatterViewItem(new Touco.Shinning.Core.Model.SurfaceItem() { FileLink = fmc.Source, FileType = "Image" }, false); scatterViewItem.InitialCompleted += delegate {
scatterViewItem.Opacity = 1; double dot = scatterViewItem.Width / scatterViewItem.Height;
scatterViewItem.Width = fmc.Width;
scatterViewItem.Height = fmc.Height;
m_OldItemHeight = fmc.Height;
m_OldItemWidth = fmc.Width; image_Back.Visibility = System.Windows.Visibility.Hidden;
scatterViewItem.CanRotate = true; ZoomOut(scatterViewItem);
}; scatterViewItem.IsShowClosed = false; ContentPresenter contentPresenter = itemsControl_Displayer.ItemContainerGenerator.ContainerFromItem(fmc) as ContentPresenter;
Point pCenter = contentPresenter.TranslatePoint(new Point(contentPresenter.ActualWidth / 2, contentPresenter.ActualHeight / 2), this);
m_OldItemCenter = pCenter; scatterViewItem.Center = pCenter;
scatterViewItem.Opacity = 0;
scatterViewItem.Orientation = 0;
scatterViewItem.DoubleTapped += new RoutedEventHandler(scatterViewItem_DoubleTapped);
surfaceScatterViewer.Items.Add(scatterViewItem); } #endregion }
}
``` ## LoadingUserControl.xaml ## ### LoadingUserControl.xaml ### <Touco_Shinning_Core_CustomControl:LoadingProgressUserControl Grid.Column="1" x:Name="loadingProgress"/> ### LoadingUserControl.xaml.cs ### namespace CFileWall
{
///
/// LoadingUserControl.xaml 的交互逻辑
///
public partial class LoadingUserControl : UserControl
{ public event EventHandler LoadingCompleted; public LoadingUserControl()
{
InitializeComponent();
Loaded += new RoutedEventHandler(LoadingUserControl_Loaded); } void LoadingUserControl_Loaded(object sender, RoutedEventArgs e)
{
//启动新的线程加载文件
new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(delegate
{
int index = 1;
if (App.Files == null) return;
foreach (var file in App.Files)
{
this.Dispatcher.Invoke((Action)delegate
{
Console.WriteLine(index); textBlock_LoadingTips.Text = index.ToString() + @"/" + App.Files.Length.ToString();
loadingProgress.Value = (double)index / App.Files.Length * 100;
}, null); Touco.Shinning.Core.Model.EnumClass.SurfaceFileType type =
Touco.Shinning.Core.Model.SurfaceFileTypeConverter.Parse(file.FullName);
App.FileModels[index - 1] = new Model.FileModel(file.FullName, type);
System.Threading.Thread.Sleep(100); index++;
} if (LoadingCompleted != null)
{
this.Dispatcher.BeginInvoke((Action)delegate
{
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(1);
dt.Tick += delegate
{
dt.Stop();
LoadingCompleted(this, null);
};
dt.Start();
}, null);
}
})).Start();
}
}
} ## MainWindow.xaml ## ### MainWindow.xaml ### <Touco_Shinning_Core_CustomControl:AbstractItemWindow x:Class="CFileWall.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Touco_Shinning_Core_CustomControl="clr-namespace:Touco.Shinning.Core.CustomControl;assembly=Touco.Shinning.Core"
xmlns:Local="clr-namespace:CFileWall"
Title="MainWindow" WindowState="Maximized" WindowStyle="None"> ### MainWindow.xaml.cs ### namespace CFileWall
{
///
/// MainWindow.xaml 的交互逻辑
///
public partial class MainWindow : Touco.Shinning.Core.CustomControl.AbstractItemWindow
{
public MainWindow()
{
InitializeComponent(); Loaded += delegate { //获取文件夹及其子文件夹下的所有符合条件的文件
App.Files = "*.png|*.jpg|*.jpeg|*.gif".Split('|').SelectMany(filter => new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonPictures) + @"\Sample Pictures").GetFiles(filter, SearchOption.AllDirectories)).ToArray(); List tempFileInfo = new List(); for (int i = 0; i < App.Files.Length; i++)
{
if(tempFileInfo.FirstOrDefault(_=>_.FullName.Equals(App.Files[i].FullName)) == null)
{
tempFileInfo.Add(App.Files[i]);
}
} App.FileModels = new Model.FileModel[App.Files.Length]; }; loadingUserControl.LoadingCompleted += delegate {
MessageBox.Show("加载完毕");
this.Topmost = true;
this.Topmost = false; this.grid_Root.Children.Remove(loadingUserControl);
this.grid_Root.Children.Add(new FileWallUserControl());
}; } protected override void GetConfigFromArgs()
{ }
}
} ## \Control\CS\FileWallItemsControl.cs ## namespace CFileWall.Control.CS
{
///
/// 文件容器控件,实现自定义布局
///
public class FileWallItemsControl : ItemsControl
{
public const int ROWS = 3;
public const int COLUMNS = 6;
public const double TOPDISTANCE = 120D;
public const double LEFTDISTANCE = 50D; private double m_VerticalDistance, m_HorizontalDistance;
private double m_TempX = LEFTDISTANCE;
private double m_TempY = TOPDISTANCE;
private int m_TempIndex = 0;
private Canvas m_ItemPanle; public FileWallItemsControl()
{
m_VerticalDistance = (ConstantClass.SysHeight - 2 * TOPDISTANCE - ROWS * ConstantClass.ELEMENTHEIGHT) / (ROWS - 1);
m_HorizontalDistance = (ConstantClass.SysWidth - 2 * LEFTDISTANCE - COLUMNS * ConstantClass.ELEMENTWIDTH) / (COLUMNS - 1); Loaded += delegate
{
m_ItemPanle = Touco.Shinning.Core.UtilityFunctions.Sinnel.Util.WPFUtil.FindPanelForInternal(this) as Canvas;
if (Items.Count % ROWS == 0)
{
m_ItemPanle.Width = m_TempX + LEFTDISTANCE;
}
else
{
m_ItemPanle.Width = m_TempX + LEFTDISTANCE + ConstantClass.ELEMENTWIDTH;
}
};
} protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
{
Model.FileModelContainer viewModel = e.NewItems[0] as Model.FileModelContainer; if (m_TempIndex % ROWS == 0)
{
m_TempX += m_HorizontalDistance + ConstantClass.ELEMENTWIDTH;
m_TempY = TOPDISTANCE;
}
else
m_TempY += m_VerticalDistance + ConstantClass.ELEMENTHEIGHT; viewModel.CanvasLeft = m_TempX;
viewModel.CanvasTop = m_TempY; m_TempIndex++;
}
else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Reset)
{
foreach (Model.FileModelContainer item in Items)
{
item.CanvasLeft = m_TempX;
item.CanvasTop = m_TempY; m_TempIndex++; if (m_TempIndex % ROWS == 0)
{
m_TempX += m_HorizontalDistance + ConstantClass.ELEMENTWIDTH;
m_TempY = TOPDISTANCE;
}
else
m_TempY += m_VerticalDistance + ConstantClass.ELEMENTHEIGHT;
} }
base.OnItemsChanged(e);
}
}
} ## \Control\XAML\FileElementUserControl.xaml ## ### FileElementUserControl.xaml ### ### FileElementUserControl.xaml.cs ### namespace CFileWall.Control.XAML
{
///
/// FileElementUserControl.xaml 的交互逻辑
/// 单个文件
///
public partial class FileElementUserControl : UserControl
{
///
/// 文件名和预览图
///
public string Source
{
get { return (string)GetValue(SourceProperty); }
set { SetValue(SourceProperty, value); }
} public static readonly DependencyProperty SourceProperty =
DependencyProperty.Register("Source", typeof(string), typeof(FileElementUserControl), new UIPropertyMetadata(string.Empty, (d, p) =>
{
string fileName = p.NewValue.ToString();
if (System.IO.File.Exists(fileName))
{
(d as FileElementUserControl).image_Displayer.Source = App.FileModels.Single(_ => _.FullName.Equals(fileName)).Thumbnail;
(d as FileElementUserControl).textBlock_FileName.Text = new System.IO.FileInfo(fileName).Name.Remove(new System.IO.FileInfo(fileName).Name.LastIndexOf('.'));
Console.WriteLine(App.FileModels.Single(_ => _.FullName.Equals(fileName)).IsResolvedSuccessfully.ToString());
}
})); ///
/// 文件类型,如果是Video,则显示播放按钮
///
public Touco.Shinning.Core.Model.EnumClass.SurfaceFileType Type
{
get { return (Touco.Shinning.Core.Model.EnumClass.SurfaceFileType)GetValue(TypeProperty); }
set { SetValue(TypeProperty, value); }
} public static readonly DependencyProperty TypeProperty =
DependencyProperty.Register("Type", typeof(Touco.Shinning.Core.Model.EnumClass.SurfaceFileType), typeof(FileElementUserControl), new UIPropertyMetadata(Touco.Shinning.Core.Model.EnumClass.SurfaceFileType.Video, (d, p) => {
if ((Touco.Shinning.Core.Model.EnumClass.SurfaceFileType)p.NewValue != Touco.Shinning.Core.Model.EnumClass.SurfaceFileType.Video)
{
(d as FileElementUserControl).image_PlayerButton.Visibility = Visibility.Hidden;
}
})); public FileElementUserControl()
{
InitializeComponent();
} protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters)
{
//return base.HitTestCore(hitTestParameters);
return new PointHitTestResult(this, hitTestParameters.HitPoint);
} }
} ## \Model\FileModel.cs ## namespace CFileWall.Model
{
///
/// 文件模型类
///
public class FileModel
{
///
/// 文件全路径
///
private string _fullName = string.Empty;
public string FullName { get { return _fullName; } } ///
/// 文件类型
///
public Touco.Shinning.Core.Model.EnumClass.SurfaceFileType FileType { get; private set; } ///
/// 缩略图
///
public BitmapSource Thumbnail { get; set; } ///
/// 是否取得缩略图
///
public bool IsResolvedSuccessfully { get; private set; }
public bool IsOfficeToXpsSuccessfully { get; private set; }//office转换xps文档是否成功 public FileModel(string fullName, Touco.Shinning.Core.Model.EnumClass.SurfaceFileType fileType)
{
_fullName = fullName;
FileType = fileType; switch (FileType)
{
case Touco.Shinning.Core.Model.EnumClass.SurfaceFileType.Image:
ResolveImage();
break;
case Touco.Shinning.Core.Model.EnumClass.SurfaceFileType.Video:
ResolveVideo();
break;
case Touco.Shinning.Core.Model.EnumClass.SurfaceFileType.Office:
//ResolveOfficeUsingIcon();
break;
default:
//ResolveUnknown();
break;
}
} private void ResolveImage()
{
BitmapSource bitmap = null;
if (Touco.Shinning.Core.UtilityFunctions.Sinnel.Util.Folder.Folder.GetFileThumb(FullName, out bitmap))
{
Thumbnail = bitmap;
IsResolvedSuccessfully = true; } //BitmapSource bitmap = GetThumbnail(FullName);
//if (bitmap != null)
//{
// Thumbnail = bitmap;
// IsResolvedSuccessfully = true;
//}
} private void ResolveVideo()
{
string tempXpsDirectory = GlobalEnvironment.GetPath(GlobalEnvironment.SpecialFolder.TempXPSFolder); if (!Directory.Exists(tempXpsDirectory))
{
File.Create(tempXpsDirectory);
} } private void ResolveOffice()
{
string tempXpsDirectory = GlobalEnvironment.GetPath(GlobalEnvironment.SpecialFolder.TempXPSFolder); if (!Directory.Exists(tempXpsDirectory))
{
File.Create(tempXpsDirectory);
} } public BitmapSource GetThumbnail(string file)
{
var decoder = BitmapDecoder.Create(new Uri(file), BitmapCreateOptions.DelayCreation, BitmapCacheOption.None);
var frame = decoder.Frames.FirstOrDefault(); return (frame.Thumbnail == null) ? null : frame.Thumbnail;
} } } ## \Model\FileModelContainer.cs ## namespace CFileWall.Model
{
///
/// 文件模型容器
///
public class FileModelContainer : Touco.Shinning.Core.Model.AbstractViewModelBase
{
///
/// 文件
///
private FileModel m_FileModel; public string Source
{
get { return (string)GetValue(SourceProperty); }
set { SetValue(SourceProperty, value); }
} public static readonly DependencyProperty SourceProperty =
DependencyProperty.Register("Source", typeof(string), typeof(FileModelContainer), new UIPropertyMetadata(string.Empty)); public Touco.Shinning.Core.Model.EnumClass.SurfaceFileType Type
{
get { return (Touco.Shinning.Core.Model.EnumClass.SurfaceFileType)GetValue(TypeProperty); }
set { SetValue(TypeProperty, value); }
} public static readonly DependencyProperty TypeProperty =
DependencyProperty.Register("Type", typeof(Touco.Shinning.Core.Model.EnumClass.SurfaceFileType), typeof(FileModelContainer), new UIPropertyMetadata(Touco.Shinning.Core.Model.EnumClass.SurfaceFileType.Video)); public FileModelContainer(FileModel fileModel)
{
m_FileModel = fileModel;
Source = m_FileModel.FullName;
Type = m_FileModel.FileType;
Width = CFileWall.Tools.ConstantClass.ELEMENTWIDTH;
Height = CFileWall.Tools.ConstantClass.ELEMENTHEIGHT;
} protected override void OnLoaded(Touco.Shinning.Core.UtilityFunctions.Sinnel.Mvvm.Command.CommandParameter param)
{
base.OnLoaded(param);
} }
} ## \Tools\ConstantClass.cs ## namespace CFileWall.Tools
{
///
/// 常量类,保存的都是程序需要的常量
///
public class ConstantClass
{
///
/// 文件宽度
///
public const double ELEMENTWIDTH = 301D; ///
/// 文件高度
///
public const double ELEMENTHEIGHT = 247D; ///
/// 配置文件路径
///
public static string ConfigFolderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config"); public static string Tag { get; set; } public static bool IsSetting { get; set; } public static string[] Args; ///
/// 默认分辨率
///
internal const double SysWidth = 1920D;
internal const double SysHeight = 1080D; }
} 有问题或建议请反馈到: 微博 :[@Changweihua](http://weibo.com/changweihua) 邮箱 :changweihua@outlook.com

文件墙 CFilewall的更多相关文章

  1. 修改hosts文件解决OneDrive被墙的问题

    增加如下内容就可以了.如果不知道修改hosts文件的具体方法请自行百度. 134.170.108.26 onedrive.live.com 134.170.108.152 skyapi.onedriv ...

  2. GitHub的css/js文件给墙了的解决方法

    今天早上一打开github发现css等都加载失败. 后来发现是给墙了. 本人用的是windows. 解决方法:改hosts 一般情况是在这里:C:\Windows\System32\drivers\e ...

  3. 对表白墙js文件的解释

    index.js 1 Page({ 2 3 /** 4 * 页面的初始数据 5 */ 6 data: { 7 xcx_appid:"", 8 }, 9 HuoquDaohangLi ...

  4. 对表白墙wxml文件解释

    一.index.wxml 1.代码 1 <view class="Beijingse" style="height: 100%;"> 2 <v ...

  5. ,net core mvc 文件上传

    工作用到文件上传的功能,在这个分享下 ~~ Controller: public class PictureController : Controller { private IHostingEnvi ...

  6. VS2015墙内创建ionic2 【利用nrm更换源,完美!】

    STEP 1 设置cnpm npm install -g cnpm --registry=https://registry.npm.taobao.org   一句话建立cnpm STEP 2 安装nr ...

  7. gradlew wrapper使用下载到本地的gradle.zip文件装配--转

    原文地址:http://www.myexception.cn/mobile/1860089.html gradlew wrapper使用下载到本地的gradle.zip文件安装.使用gradlew来b ...

  8. C#Excel文件加密实现,支持xlsx、docx、pptx(C#\Net\Asp.Net)

    从此刻开始,我已封闭!概不接客! 像风一样的男人,像风一样的性格,无拘无束,不拘一格.那么问题来了,当风遇到沙,不一定你是风儿,我是沙儿的缠缠绵绵,.也许是漫天黄沙,飞粒走石.如果我们期望擒住这漫天的 ...

  9. CentOS系统中基于Apache+php+mysql的许愿墙网站的搭建

    1.首先,我们需要两台虚拟机(CentOS7,Linux文本). 2.给两台虚拟机配置网络环境分别为桥接模式 CentOS7 ip为192.168.100.139.24,linux文本ip为192.1 ...

随机推荐

  1. FileSystemWatcher触发多次Change事件的解决办法 .

    最近要用到FileSystemWatcher来监控某个目录中的文件是否发生改变,如果改变就执行相应的操作.但在开发过程中,发现FileSystemWatcher在文件创建或修改后,会触发多个Creat ...

  2. Blocks 推出矩阵公式。矩阵快速密

    Blocks 设涂到第I块时,颜色A,B都为偶数的数量为ai,一奇一偶的数量为bi,都为奇数为ci,  那么涂到第i+1快时有 a[i+1]=2*a[i]+b[i]+0*c[i]; b[i+1]=2* ...

  3. double数值多时系统默认科学计数法解决方法

    比如 Double d = new Double("1234567890.12"); System.out.println("d:="+d); java.tex ...

  4. Xutils3的使用

    Xutils是前两年很火的一个三方库(githup地址),是一个工具类,分为4个模块:DbUtils.HttpUtils.ViewUtils. BitmapUtils,还有一个非常使用功能就是LogU ...

  5. [Java,JavaEE] 最常用的Java库一览

    引用自:http://www.importnew.com/7530.html 本文由 ImportNew - 邢 敏 翻译自 programcreek.欢迎加入Java小组.转载请参见文章末尾的要求. ...

  6. Js 实现五级联动

    js实现多级联动的方法很多,这里给出⼀种5级联动的例子,其实可以扩展成N级联动,在做项目的时候碰到了这样⼀个问题但是有不能从数据库中动态的加载这些选项,所以只有想办法从单个的页面着手来处理了,应为项目 ...

  7. Error reading from file 解决办法

    最近安装程序遇见这个问题: Error reading from file. 解决办法: 给这个程序添加权限: 添加SYSTEM的读写改..如果比较懒,直接全部允许. 然后Retry.

  8. node.js学习的资源整理

    node中文社区 Node.js专业中文社区:https://cnodejs.org/ node文档 node.js 中文api :http://nodeapi.ucdok.com/ node.js入 ...

  9. [书目20131223]Android、iPhone、Windows Phone手机网页及网站设计:最佳实践与设计精粹 - 张亚飞

    目录 第I篇 手机版专用网站设计和开发入门篇 第1章 准备创作环境和测试环境 3 1.1 使用Mobile Safari测试网页 4 1.1.1 iOS Simulator安装 5 1.1.2 使用M ...

  10. hdu-5698 瞬间移动(数论+快速幂)

    题目链接: 瞬间移动 Problem Description   有一个无限大的矩形,初始时你在左上角(即第一行第一列),每次你都可以选择一个右下方格子,并瞬移过去(如从下图中的红色格子能直接瞬移到蓝 ...