User Profile

Collapse

Profile Sidebar

Collapse
Anton Zinchenko
Anton Zinchenko
Last Activity: Jul 10 '11, 01:06 PM
Joined: Sep 2 '10
Location: Novosibirsk, Russia
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • generic base class where T is other generic base class

    I have an abstract generic class:

    Code:
        public abstract class SomeBaseClass<U,V>
        {
        }
    I want to create other generic class:

    Code:
        public abstract class SomeOtherBaseClass<T1, T2> where T1 : SomeBaseClass<U,V>
        {
            private readonly T1 _someBaseClass;
        
            public SomeOtherBaseClass(T1 someBaseClass)
            {
    ...
    See more | Go to post

  • Code:
    private void btnXML_Click(object sender, EventArgs e)
     {  //validate data pior to create XML File
     
       [B]if ((this.txtXMLFolder.Text == "" ) ||  (this.txtXMLName.Text == "") ||  (this.lblCustID.Text == ""))[/B]
        {
         string txtmsg = "Either one of these data is missing" + "\n";
         txtmsg += "Customer Selection" + "\n";
         txtmsg += "XML
    ...
    See more | Go to post

    Leave a comment:


  • Method RetrieveBook have a param, so it can't be called without it...
    Code:
            public void TestStoreAndRetrieve()
            {
                Factory factory = Factory.GetInstance();
                IBookService bookSvc = (IBookService)factory.GetService(typeof(IBookService).Name);
                Book book1 = new Book("9781426829758", "Stock", "Dark Rival", "Masters of Time", "Brenda
    ...
    See more | Go to post

    Leave a comment:


  • You must implement IBookService interface:

    Code:
    public class BookSvcBinImpl : IBookService
        {
            public void StoreBook(Book bookX)
            {
                IList<Book> listBooks = new IList<Book>();
                FileStream saveStream = new FileStream("Book.bin", FileMode.Create, FileAccess.Write);
                IFormatter formatter = new BinaryFormatter();
                formatter.Serialize(saveStream,
    ...
    See more | Go to post

    Leave a comment:


  • Anton Zinchenko
    replied to How to cycle through 2d array
    Code:
                for (int i = 0; i < resultsArray.Rank + 1; i++)
                {
                    for (int j = 0; j < resultsArray.Length / (resultsArray.Rank + 1); j++)
                    {
                        Console.Write(resultsArray[i, j]);
                    }
                    Console.WriteLine();
                }
    See more | Go to post

    Leave a comment:


  • Anton Zinchenko
    replied to C#NET2008 Microsoft WORD 2003
    I think it should be something like this:
    Code:
    Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
    Microsoft.Office.Interop.Word.Document wordDoc = wordApp.Documents.Add(...);
    See more | Go to post

    Leave a comment:


  • Anton Zinchenko
    replied to how do I shrink my solution dll
    Build you assembly in Release configuration, set debug info in advanced build settings to none...
    See more | Go to post

    Leave a comment:


  • Anton Zinchenko
    replied to Translasion af VB to C#
    Code:
    ret = objOCR.OCRSetOutputHandlerX(AddressOf myOutputHandler)
    Will be
    Code:
    ret = objOCR.OCRSetOutputHandlerX(new MyDelegateType(myOutputHandler))
    Replace the "MyDelegateType " by your type...
    See more | Go to post

    Leave a comment:


  • Anton Zinchenko
    replied to TreeView leaf node click event
    What about NodeMouseClick and NodeMouseDouble Click events?

    Code:
            private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
            {
                if (e.Node.Parent == null)
                {
                    MessageBox.Show("Root node");
                }
                else
                {
                    MessageBox.Show(e.Node.Text);
                }
    ...
    See more | Go to post

    Leave a comment:


  • I can't figure out what you mean by "...set the 'Center In Form' property of the labels and textboxes to 'Horizontally' and 'Vertically'... ", but maybe setting the Anchor property of your labels and texboxes to None will solve your problem...
    See more | Go to post

    Leave a comment:


  • Use ExecuteScalar() instead of ExecuteReader() .
    Code:
                try {
                    com = new OleDbCommand("Select Max(sid) from Students", con);
                    TextBox1.Text = com.ExecuteScalar().ToString();
                    Label6.Text = "New Id Ok";  
                }
                catch(Exception ex){
                    Label6.Text = ex.ToString();
                }
    See more | Go to post

    Leave a comment:


  • Instead of creating a new array each time, use
    Code:
    Array.Resize(ref array, newsize)
    . Or you can use a collection:

    Code:
    List<string> myCollection = new List<string>();
    private void Combobox_SelectedIndexChanged(object sender, EventArgs e)
    {
    SqlCommand getCar = new SqlCommand("select Car from myTable where carID = '"+ 3 +"' ", myConnection);
    myCar = getCar.ExecuteNoneQuery();
    ...
    See more | Go to post

    Leave a comment:


  • Maybe you made a typo?
    Code:
                for (int i = 0; i < fr.Length; i++)
                {
                    if (fr[i] < max)
                    {
                        max = (int)Math.Ceiling([B]fr[i][/B]);
                    }
                }
    If it's not a typo, than you can cast i to double and it should work (max = (int)Math.Ceili ng((double)i);)
    See more | Go to post
    Last edited by Anton Zinchenko; Sep 20 '10, 06:36 PM. Reason: additional comment

    Leave a comment:


  • Anton Zinchenko
    replied to Combobox not clearing
    I think the problem line in your code is:
    Code:
    ad.Fill(dt);
    You are using Fill method on the same DataTable multiply times, so the incoming rows are appended to the DataTable.
    See more | Go to post

    Leave a comment:


  • I'm still has no luck with this question...

    Host application:
    Code:
        public partial class Form1 : Form
        {
            private AssemblyLoader _aLoader = null;
    
            public Form1()
            {
                InitializeComponent();
    
                AppDomain _domain = AppDomain.CreateDomain("Remote Load");
                _aLoader = (AssemblyLoader)_domain.CreateInstanceAndUnwrap(
    ...
    See more | Go to post

    Leave a comment:


  • Anton Zinchenko
    started a topic Plugin architecture and event handlers

    Plugin architecture and event handlers

    I'm trying to write some kind of plugin framework... It looks something like this:
    Host Application (Windows Form Application) loads plugins into separate AppDomains (each plugin into own AppDomain).
    How to set a method from plugin as eventhandler for MenuItem Click event (MenuStrip is on the main form of host application) and prevent loading plugin assembly into the main AppDomain?
    See more | Go to post
No activity results to display
Show More
Working...