示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            //  Get the vendor strings.
            OpenGLVendor = ApplicationState.Instance.OpenGL.Vendor;
            OpenGLVersion = ApplicationState.Instance.OpenGL.Version;
            OpenGLRenderer = ApplicationState.Instance.OpenGL.Renderer;
            OpenGLShadingLanguageVersion = ApplicationState.Instance.OpenGL.GetString(OpenGL.GL_SHADING_LANGUAGE_VERSION);
        
            //  If the strings are empty, set them to something more descriptive.
            if (string.IsNullOrEmpty(OpenGLVendor)) OpenGLVendor = "<none>";
            if (string.IsNullOrEmpty(OpenGLVersion)) OpenGLVersion = "<none>";
            if (string.IsNullOrEmpty(OpenGLRenderer)) OpenGLRenderer = "<none>";
            if (string.IsNullOrEmpty(OpenGLShadingLanguageVersion)) OpenGLShadingLanguageVersion = "<none>";

            //  Create the commands.
            FileNewCommand = new Command(DoFileNewCommand);
            FileOpenCommand = new Command(DoFileOpenCommand);
            FileSaveCommand = new Command(DoFileSaveCommand);
            FileSaveAsCommand = new Command(DoFileSaveAsCommand);
            FileExitCommand = new Command(DoFileExitCommand);
            ViewShowOutputWindowCommand = new Command(DoViewShowOutputWindowCommand);
            BuildCompileCommand = new Command(DoBuildCompileCommand);
            BuildLinkCommand = new Command(DoBuildLinkCommand);
            BuildBuildCommand = new Command(DoBuildBuildCommand);
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainViewModel"/> class.
 /// </summary>
 public MainViewModel()
 {
     StartCommandPromptCommand = new Command(() => { });
     StartNewProcessCommand = new Command(() => { });
     StopProcessCommand = new Command(() => { });
     ClearOutputCommand = new Command(() => { });
 }
 public ImageTileViewModel(wndMainViewModel viewModel, int index)
 {
     this.viewModel = viewModel;
     GetUriToClipboardCommand = new Command(GetUriToClipboard);
     this.AddDownloadQueryItemCommand = new AddDownloadQueryItemCommand(this, viewModel);
     this.CallFullsizeModeCommand = new CallFullsizeModeCommand(viewModel, index);
 }
示例#4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TheShellViewModel"/> class.
        /// </summary>
        public TheShellViewModel()
        {
            Title = "The Shell";

            //  Create the show popup command. It actually won't do anything in the 
            //  view model, but a view can still handle it.
            ShowPopupCommand = new Command(() => { });
        }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ListTscViewModel"/> class.
 /// </summary>
 public LightCheckViewModel()
 {
     //  TODO: Use the following snippets to help build viewmodels:
     //      apexnp - Creates a Notifying Property
     //      apexc - Creates a Command.
     Title = "灯泡检测";
     SaveLightCheck = new Command(DoSaveLightCheck);
     ResetLightCheck = new Command(DoSaveLightCheck);
 }
示例#6
0
        public RibbonViewModel()
        {
            loadSceneCommand = new Command(DoLoadSceneCommand);

            addCubeCommand = new Command(() => Scene.SceneContainer.AddChild(new SharpGL.SceneGraph.Primitives.Cube()));
            addSphereCommand = new Command(() => Scene.SceneContainer.AddChild(new SharpGL.SceneGraph.Quadrics.Sphere()));
            addCylinderCommand = new Command(() => Scene.SceneContainer.AddChild(new SharpGL.SceneGraph.Quadrics.Cylinder() { Name = "Cylinder", TopRadius = 1, Height = 2 }));
            addConeCommand = new Command(() => Scene.SceneContainer.AddChild(new SharpGL.SceneGraph.Quadrics.Cylinder() { Name = "Cone", TopRadius = 0, Height = 2 }));
            addDiskCommand = new Command(() => Scene.SceneContainer.AddChild(new SharpGL.SceneGraph.Quadrics.Disk()));
        }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhaseViewModel"/> class.
 /// </summary>
 public PhaseViewModel()
 {
     Title = "相位";
     ShowPopupCommandSouthLeft = new Command(DoShowPopupCommandSouthLeft);
     ShowPopupCommandSouthStaight = new Command(DoShowPopupCommandSouthStaight);
     ShowPopupCommandSouthRight = new Command(DoShowPopupCommandSouthRight);
     ShowPopupCommandSouthOther = new Command(DoShowPopupCommandSouthOther);
     ShowFailePopup = new Command(DoShowFailePopup);
      
     
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DetectorViewModel"/> class.
 /// </summary>
 public DetectorViewModel()
 {
     //  TODO: Use the following snippets to help build viewmodels:
     //      apexnp - Creates a Notifying Property
     //      apexc - Creates a Command.
     Title = "检测器";
     ShowPopupCommandDetector1 = new Command(DoShowPopupCommandDetector1);
     ShowPopupCommandDetector2 = new Command(DoShowPopupCommandDetector2);
     ShowPopupCommandDetector3 = new Command(DoShowPopupCommandDetector3);
     ShowPopupCommandDetector4 = new Command(DoShowPopupCommandDetector4);
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VariableSignViewModel"/> class.
 /// </summary>
 public ConfigViewModel()
 {
     //  TODO: Use the following snippets to help build viewmodels:
     //      apexnp - Creates a Notifying Property
     //      apexc - Creates a Command.
     Title = "系统配置";
     SaveYellowFlashCommand = new Command(DoSaveYellowFlashCommand);
     BuildSNCommand = new Command(DoBuildSNCommand);
     SetLampCheckCommand = new Command(DoSetLampCheckCommand);
     SetCountDownCommand = new Command(DoSetCountDownCommand);
 }
        public RssViewModel(string rssDbConnectionString)
        {
            _parseRss = new ParseRss(this);
            _rssDb = new BaseDataContext(rssDbConnectionString);

            _addChannelCommand = new Command(DoAddChanel);

            AllArticles = new ObservableCollection<Article>();
            NewArticles = new ObservableCollection<Article>();
            StaredArticles = new ObservableCollection<Article>();
        }
示例#11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            //  TODO: Use the following snippets to help build viewmodels:
            //      apexnp - Creates a Notifying Property
            //      apexc - Creates a Command.

            AddContactCommand = new Command(DoAddContactCommand);
            DeleteContactCommand = new Command(DoDeleteContactCommand, false);

            /*Contacts.Add(new ContactViewModel() { Name = "Homer" });
            Contacts.Add(new ContactViewModel() { Name = "Marge" });
            Contacts.Add(new ContactViewModel() { Name = "Maggie" });*/
        }
示例#12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainViewModel"/> class.
 /// </summary>
 public MainViewModel()
 {
     loadDataCommand = new Command(DoLoadData, true);
     saveCommand = new Command(DoSaveCommand, true);
     rotateXCommand = new Command(
         () =>
         {
             foreach (var polygon in Scene.SceneContainer.Traverse<Polygon>())
                 polygon.Transformation.RotateX += 90f;
         }, true);
     rotateYCommand = new Command(
         () =>
         {
             foreach (var polygon in Scene.SceneContainer.Traverse<Polygon>())
                 polygon.Transformation.RotateY += 90f;
         }, true);
     rotateZCommand = new Command(
         () =>
         {
             foreach (var polygon in Scene.SceneContainer.Traverse<Polygon>())
                 polygon.Transformation.RotateZ += 90f;
         }, true);
     CreateScene();
 }
示例#13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThePagesViewModel"/> class.
 /// </summary>
 public DegradationViewModel()
 {
     Title = "联网降级";
     DegradationCommand = new Command(DoDegradationCommand);
 }
示例#14
0
 public ShaderViewModel()
 {
     CompileCommand = new Command(DoCompileCommand, true);
 }
示例#15
0
 public ImageTileViewModel()
 {
     GetUriToClipboardCommand = new Command(GetUriToClipboard);
 }