private void cmdOK_Click(object sender, EventArgs e) { BlockHandle cid = null; if (txtProduct.Text == "" ) { cid = BlockHandle.New(txtId.Text); } else { cid = BlockHandle.New(txtId.Text, txtProduct.Text); } if ( txtVersion.Text != "" ) { BlockVersion ver = new BlockVersion(txtVersion.Text); cid.BlockVersion = ver; } try { resultId = myWeb.AddBlock(cid); DialogResult = System.Windows.Forms.DialogResult.OK; } catch (Exception exc) { DialogResult = System.Windows.Forms.DialogResult.Cancel; MessageBox.Show("Error Adding Block: " + exc.Message, "Error"); } finally { Close(); } }
public BlockHandle(string clsName, BlockVersion version) { ClassName = clsName; BlockVersion = version; }
public BlockHandle(string clsName, BlockVersion version, string product) { ClassName = clsName; Product = product; BlockVersion = version; }
public void InitFrom(BlockHandle v) { ClassName = v.ClassName; BlockVersion = v.BlockVersion; Product = v.Product; }
/// <summary> /// Returns true if minor and major parts of both versions are the same. When a specific version of a block is not /// found compatible blocks can be used instead /// </summary> /// <param name="v"></param> /// <returns></returns> public bool IsCompatible(BlockVersion v) { if (this.Major == v.Major && this.Minor == v.Minor) { return true; } return false; }
public object Clone() { BlockVersion BlockVersion = new BlockVersion(); BlockVersion._Major = this._Major; BlockVersion._Minor = this._Minor; BlockVersion._Build = this._Build; BlockVersion._Revision = this._Revision; return BlockVersion; }