コード例 #1
0
 public TemplatePropeties(TemplateView template)
 {
     this.template = template;
 }
コード例 #2
0
 public void DeleteTemplate(string templateViewName)
 {
     try
     {
         if (this.templateViews.ContainsKey(templateViewName))
         {
             TemplateView templateView = this.templateViews[templateViewName];
             if (templateView != null)
             {
                 templateView.CurrentState = TemplateView.ContentState.OpeningOrClosing;
                 templateView.Hide();
                 if (templateView.FormObj.GetType().BaseType == typeof(ClientBaseForm))
                 {
                     frmMain.OnMessageReceived -= new frmMain.OnMessageRecievedEventHendler((templateView.FormObj as IRealtimeMessage).ReceiveMessage);
                     ((ClientBaseForm)templateView.FormObj).FormState = ClientBaseForm.ClientBaseFormState.Closing;
                     templateView.FormObj.Dispose();
                     templateView.FormObj = null;
                 }
                 if (this.currentActiveTemplateView == this.templateViews[templateViewName])
                 {
                     this.currentActiveTemplateView = null;
                 }
                 this.templateViews.Remove(templateViewName);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
 public void Show(string templateViewName)
 {
     try
     {
         TemplateView templateView = null;
         if (this.currentActiveTemplateView != null)
         {
             if (this.currentActiveTemplateView.Name != templateViewName)
             {
                 templateView = this.currentActiveTemplateView;
             }
         }
         if (this.templateViews.ContainsKey(templateViewName))
         {
             this.currentActiveTemplateView = this.templateViews[templateViewName];
             this.currentActiveTemplateView.Show();
         }
         if (templateView != null)
         {
             templateView.Hide();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #4
0
 public TemplateView CreateTemplateView(string templateName)
 {
     TemplateView result;
     if (this.IsTemplateContains(templateName))
     {
         result = null;
     }
     else
     {
         TemplateView templateView = new TemplateView(templateName);
         this.templateViews.Add(templateView.Name, templateView);
         result = templateView;
     }
     return result;
 }