예제 #1
0
        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();
            }
        }
예제 #2
0
 public BlockHandle(string clsName, BlockVersion version)
 {
     ClassName = clsName;
     BlockVersion = version;
 }
예제 #3
0
 public BlockHandle(string clsName, BlockVersion version, string product)
 {
     ClassName = clsName;
     Product = product;
     BlockVersion = version;
 }
예제 #4
0
 public void InitFrom(BlockHandle v)
 {
     ClassName = v.ClassName;
     BlockVersion = v.BlockVersion;
     Product = v.Product;
 }
예제 #5
0
        /// <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;
        }
예제 #6
0
 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;
 }