前/后递增/递减运算符(++和--)是非常标准的编程语言语法(至少对于过程语言和面向对象语言).
为什么Ruby不支持它们?我知道你可以用+=和完成同样的事情-=,但是排除这样的东西似乎有点奇怪,特别是因为它是如此简洁和传统.
例:
i = 0 #=> 0
i += 1 #=> 1
i #=> 1
i++ #=> expect 2, but as far as I can tell,
#=> irb ignores the second + and waits for a second number to add to i
Run Code Online (Sandbox Code Playgroud)
我理解Fixnum是不可改变的,但如果+=能够实现一个新的Fixnum并设置它,为什么不做同样的事情++呢?
包含=角色的作业的一致性是唯一的原因,还是我错过了什么?
环境:
Windows XP计算机
安装了Excel 2007和Excel 2003(按此顺序,而不是按时间顺序).
C#3.5
问题:
当我使用PIA进行一些Office自动化时,我使用以下代码行:
var excel = new ApplicationClass();
Run Code Online (Sandbox Code Playgroud)
PIA的版本特别指它为Excel 12.
C:\ WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll
但是:
excel.Version;//this is 11.0 instead of 12.0
Run Code Online (Sandbox Code Playgroud)
因此,当我尝试打开一个扩展名为.xlsx的文件时,它会警告我文件转换中的功能丢失,并使用excel 2003打开它.我很确定它与安装顺序是2007 - > 2003,但我无法在我的机器上卸载2003 b/c我们在我们的网络服务器上有一些办公室自动化,用于使用excel 2003的无关项目.
我查看了Policy.11.0.Microsoft.Office.Interop.Excel.config的内容,但它说
<bindingRedirect oldVersion="11.0.0.0" newVersion="12.0.0.0"></bindingRedirect>
Run Code Online (Sandbox Code Playgroud)
所以,我不知所措.为什么我不能告诉COM Interop使用哪个版本的Excel?
一,截图:

标题和图像很好地解释了它.我的应用主视图组右侧有一个广告设置(非常类似于此示例中的默认网格模板),当我拉出"关于"屏幕时,广告会流下来.
"关于"屏幕是在SettingsFlyout上设置的用户控件,我从一个开发营地(下面)发布的一些代码示例中借用了这些控件.
class SettingsFlyout
{
private const int _width = 346;
private Popup _popup;
public void ShowFlyout(UserControl control)
{
_popup = new Popup();
_popup.Closed += OnPopupClosed;
Window.Current.Activated += OnWindowActivated;
_popup.IsLightDismissEnabled = true;
_popup.Width = _width;
_popup.Height = Window.Current.Bounds.Height;
control.Width = _width;
control.Height = Window.Current.Bounds.Height;
_popup.Child = control;
_popup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - _width);
_popup.SetValue(Canvas.TopProperty, 0);
_popup.IsOpen = true;
}
private void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
{
if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
{
_popup.IsOpen = false;
}
}
void OnPopupClosed(object sender, object e) …Run Code Online (Sandbox Code Playgroud) 我做了一些关于这个错误的研究,我找到的所有发现包括从方法或属性中删除静态,但在我的代码中没有任何静态,所以我不知道发生了什么,谢谢你的帮助.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class textoTitular : Form
{
public textoTitular()
{
InitializeComponent();
}
private void textoTitular_Load(object sender, EventArgs e)
{
textoTitular.Text = "testing"; /// prints testing on the textbox
}
}
}
Run Code Online (Sandbox Code Playgroud)